Skip to content

Commit 4f46c0f

Browse files
committed
Fix code format in README.rst
1 parent 886bf55 commit 4f46c0f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

README.rst

+7-2
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,23 @@ software, released under the MIT license.
1818

1919
spaCy finally supports another language, in addition to English. We're lucky to have Wolfgang Seeker on the team, and the new German model is just the beginning.
2020
Now that there are multiple languages, you should consider loading spaCy via the load() function. This function also makes it easier to load extra word vector data for English:
21-
21+
22+
.. code:: python
23+
2224
import spacy
23-
2425
en_nlp = spacy.load('en', vectors='en_glove_cc_300_1m_vectors')
2526
de_nlp = spacy.load('de')
2627
2728
To support use of the load function, there are also two new helper functions: spacy.get_lang_class and spacy.set_lang_class.
2829
Once the German model is loaded, you can use it just like the English model:
2930

31+
.. code:: python
32+
3033
doc = nlp(u'''Wikipedia ist ein Projekt zum Aufbau einer Enzyklopädie aus freien Inhalten, zu dem du mit deinem Wissen beitragen kannst. Seit Mai 2001 sind 1.936.257 Artikel in deutscher Sprache entstanden.''')
34+
3135
for sent in doc.sents:
3236
print(sent.root.text, sent.root.n_lefts, sent.root.n_rights)
37+
3338
# (u'ist', 1, 2)
3439
# (u'sind', 1, 3)
3540

0 commit comments

Comments
 (0)