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:
Vetea 2017-06-08 11:27:09 +02:00 committed by GitHub
parent 34a2eecb17
commit cc3aee1189

View File

@ -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')