mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-04 21:50:35 +03:00
Add example to Span.merge()
This commit is contained in:
parent
404d3067b8
commit
471eed4126
|
@ -150,6 +150,13 @@ p
|
||||||
|
|
||||||
p Retokenize the document, such that the span is merged into a single token.
|
p Retokenize the document, such that the span is merged into a single token.
|
||||||
|
|
||||||
|
+aside-code("Example").
|
||||||
|
doc = nlp(u'I like New York in Autumn.')
|
||||||
|
span = doc[2:3]
|
||||||
|
span.merge()
|
||||||
|
assert len(doc) == 6
|
||||||
|
assert doc[2].text == 'New York'
|
||||||
|
|
||||||
+table(["Name", "Type", "Description"])
|
+table(["Name", "Type", "Description"])
|
||||||
+row
|
+row
|
||||||
+cell #[code **attributes]
|
+cell #[code **attributes]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user