Permalink
Browse files

made lemmatizer a global (module-level) var

  • Loading branch information...
piskvorky committed Mar 2, 2012
1 parent 2fc5e60 commit 5b35b34d643eee916e9f19401e0cfabe2f615a29
Showing with 3 additions and 1 deletion.
  1. +1 −1 gensim/corpora/wikicorpus.py
  2. +2 −0 gensim/utils.py
@@ -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)):
View
@@ -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.