2017-11-11 03:11:27 +03:00
|
|
|
# coding: utf8
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2017-11-14 17:45:50 +03:00
|
|
|
import gc
|
|
|
|
|
2017-11-11 03:11:27 +03:00
|
|
|
from ...lang.en import English
|
|
|
|
|
|
|
|
|
|
|
|
def test_issue1506():
|
|
|
|
nlp = English()
|
|
|
|
|
|
|
|
def string_generator():
|
2017-11-11 11:31:59 +03:00
|
|
|
for _ in range(10001):
|
2017-11-15 17:55:48 +03:00
|
|
|
yield u"It's sentence produced by that bug."
|
2017-11-11 03:11:27 +03:00
|
|
|
|
2017-11-14 22:58:46 +03:00
|
|
|
for _ in range(10001):
|
2017-11-15 17:55:48 +03:00
|
|
|
yield u"I erase some hbdsaj lemmas."
|
2017-11-14 22:58:46 +03:00
|
|
|
|
2017-11-11 11:31:59 +03:00
|
|
|
for _ in range(10001):
|
2017-11-15 17:55:48 +03:00
|
|
|
yield u"I erase lemmas."
|
2017-11-11 03:11:27 +03:00
|
|
|
|
2017-11-11 11:31:59 +03:00
|
|
|
for _ in range(10001):
|
2017-11-15 17:55:48 +03:00
|
|
|
yield u"It's sentence produced by that bug."
|
2017-11-11 03:11:27 +03:00
|
|
|
|
2017-11-14 17:45:50 +03:00
|
|
|
for _ in range(10001):
|
2017-11-15 17:55:48 +03:00
|
|
|
yield u"It's sentence produced by that bug."
|
2017-11-14 17:45:50 +03:00
|
|
|
|
|
|
|
for i, d in enumerate(nlp.pipe(string_generator())):
|
2017-11-14 20:28:13 +03:00
|
|
|
# We should run cleanup more than one time to actually cleanup data.
|
|
|
|
# In first run — clean up only mark strings as «not hitted».
|
2017-11-14 20:45:04 +03:00
|
|
|
if i == 10000 or i == 20000 or i == 30000:
|
2017-11-14 20:28:13 +03:00
|
|
|
gc.collect()
|
|
|
|
|
2017-11-14 18:01:37 +03:00
|
|
|
for t in d:
|
|
|
|
str(t.lemma_)
|