Skip to content

Commit

Permalink
Fix Issue #639: stop words in language class not used. This patch is …
Browse files Browse the repository at this point in the history
…messy, but it's better not to change too much until the language data loading can be properly refactored.
  • Loading branch information
honnibal committed Nov 23, 2016
1 parent 48e1dc2 commit 09f68bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spacy/language.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ def create_lemmatizer(cls, nlp=None):
def create_vocab(cls, nlp=None):
lemmatizer = cls.create_lemmatizer(nlp)
if nlp is None or nlp.path is None:
return Vocab(lex_attr_getters=cls.lex_attr_getters, tag_map=cls.tag_map,
lex_attr_getters = dict(cls.lex_attr_getters)
# This is very messy, but it's the minimal working fix to Issue #639.
# This defaults stuff needs to be refactored (again)
lex_attr_getters[IS_STOP] = lambda string: string.lower() in cls.stop_words
return Vocab(lex_attr_getters=lex_attr_getters, tag_map=cls.tag_map,
lemmatizer=lemmatizer)
else:
return Vocab.load(nlp.path, lex_attr_getters=cls.lex_attr_getters,
Expand Down

0 comments on commit 09f68bc

Please sign in to comment.