Print list comprehension

Turn the generator expression into a list comprehension before printing
This commit is contained in:
Niko Rebenich 2017-05-18 14:50:43 -07:00 committed by GitHub
parent c56c264510
commit d40b083934

View File

@ -17,10 +17,10 @@ p
| trying to do.
+code.
import spacy # See "Installing spaCy"
nlp = spacy.load('en') # You are here.
doc = nlp(u'Hello, spacy!') # See "Using the pipeline"
print((w.text, w.pos_) for w in doc) # See "Doc, Span and Token"
import spacy # See "Installing spaCy"
nlp = spacy.load('en') # You are here.
doc = nlp(u'Hello, spacy!') # See "Using the pipeline"
print([(w.text, w.pos_) for w in doc]) # See "Doc, Span and Token"
+aside("Why do we have to preload?")
| Loading the models takes ~200x longer than