mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +03:00
Use better examples for Doc extension methods
This commit is contained in:
parent
f0024e3b13
commit
153f41a5cc
|
@ -202,8 +202,8 @@ p
|
|||
|
||||
+aside-code("Example").
|
||||
from spacy.tokens import Doc
|
||||
Doc.set_extension('is_city', default=False)
|
||||
extension = Doc.get_extension('is_city')
|
||||
Doc.set_extension('has_city', default=False)
|
||||
extension = Doc.get_extension('has_city')
|
||||
assert extension == (False, None, None, None)
|
||||
|
||||
+table(["Name", "Type", "Description"])
|
||||
|
@ -227,8 +227,8 @@ p Check whether an extension has been registered on the #[code Doc] class.
|
|||
|
||||
+aside-code("Example").
|
||||
from spacy.tokens import Doc
|
||||
Doc.set_extension('is_city', default=False)
|
||||
assert Doc.has_extension('is_city')
|
||||
Doc.set_extension('has_city', default=False)
|
||||
assert Doc.has_extension('has_city')
|
||||
|
||||
+table(["Name", "Type", "Description"])
|
||||
+row
|
||||
|
@ -761,6 +761,13 @@ p
|
|||
+cell bool
|
||||
+cell A flag indicating that the document has been syntactically parsed.
|
||||
|
||||
+row
|
||||
+cell #[code is_sentenced]
|
||||
+cell bool
|
||||
+cell
|
||||
| A flag indicating that sentence boundaries have been applied to
|
||||
| the document.
|
||||
|
||||
+row
|
||||
+cell #[code sentiment]
|
||||
+cell float
|
||||
|
|
Loading…
Reference in New Issue
Block a user