mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Add read() method when opening file
Add read() method for to avoid : ```TypeError: Argument 'string' has incorrect type (expected str, got _io.TextIOWrapper)``` Test with: spaCy : v2.0.0 Alpha python : 3.5.2+ (default, Sep 22 2016, 12:18:14)
This commit is contained in:
parent
34a2eecb17
commit
cc3aee1189
|
@ -181,7 +181,7 @@ p
|
|||
from spacy.vocab import Vocab
|
||||
|
||||
nlp = spacy.load('en')
|
||||
moby_dick = open('moby_dick.txt', 'r')
|
||||
moby_dick = open('moby_dick.txt', 'r').read()
|
||||
doc = nlp(moby_dick)
|
||||
doc.to_disk('/moby_dick.bin')
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user