mirror of https://github.com/explosion/spaCy.git
Updated main to make use of lang variable (#3220)
Updated main to make use of language variable when initializing spacy.
This commit is contained in:
parent
03d58f9feb
commit
8fc6aaf134
|
@ -57,7 +57,7 @@ import spacy
|
||||||
n=("Number of texts to read", "option", "n", int),
|
n=("Number of texts to read", "option", "n", int),
|
||||||
lang=("Language class to initialise", "option", "l", str))
|
lang=("Language class to initialise", "option", "l", str))
|
||||||
def main(patterns_loc, text_loc, n=10000, lang='en'):
|
def main(patterns_loc, text_loc, n=10000, lang='en'):
|
||||||
nlp = spacy.blank('en')
|
nlp = spacy.blank(lang)
|
||||||
nlp.vocab.lex_attr_getters = {}
|
nlp.vocab.lex_attr_getters = {}
|
||||||
phrases = read_gazetteer(nlp.tokenizer, patterns_loc)
|
phrases = read_gazetteer(nlp.tokenizer, patterns_loc)
|
||||||
count = 0
|
count = 0
|
||||||
|
|
Loading…
Reference in New Issue