Skip to content

Commit

Permalink
made lemmatizer a global (module-level) var
Browse files Browse the repository at this point in the history
  • Loading branch information
piskvorky committed Mar 2, 2012
1 parent 2fc5e60 commit 5b35b34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gensim/corpora/wikicorpus.py
Expand Up @@ -178,7 +178,7 @@ def get_texts(self, return_raw=False):
articles, articles_all = 0, 0
intext, positions = False, 0
if LEMMATIZE:
lemmatizer = utils.Lemmatizer()
lemmatizer = utils.lemmatizer
yielded = 0

for lineno, line in enumerate(bz2.BZ2File(self.fname)):
Expand Down
2 changes: 2 additions & 0 deletions gensim/utils.py
Expand Up @@ -656,4 +656,6 @@ def __del__(self):
for prc in self.prcs:
prc.terminate()
logger.info("terminated %i lemmatizer processes" % self.num_workers)

lemmatizer = Lemmatizer()
#endif HAS_PATTERN

0 comments on commit 5b35b34

Please sign in to comment.