forked from explosion/spaCy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_issue1506.py
35 lines (24 loc) · 918 Bytes
/
test_issue1506.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# coding: utf8
from __future__ import unicode_literals
import gc
from ...lang.en import English
def test_issue1506():
nlp = English()
def string_generator():
for _ in range(10001):
yield u"It's sentence produced by that bug."
for _ in range(10001):
yield u"I erase some hbdsaj lemmas."
for _ in range(10001):
yield u"I erase lemmas."
for _ in range(10001):
yield u"It's sentence produced by that bug."
for _ in range(10001):
yield u"It's sentence produced by that bug."
for i, d in enumerate(nlp.pipe(string_generator())):
# We should run cleanup more than one time to actually cleanup data.
# In first run — clean up only mark strings as «not hitted».
if i == 10000 or i == 20000 or i == 30000:
gc.collect()
for t in d:
str(t.lemma_)