mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +03:00
76 lines
1.6 KiB
Plaintext
76 lines
1.6 KiB
Plaintext
//- 💫 DOCS > API > STRINGSTORE
|
|
|
|
include ../../_includes/_mixins
|
|
|
|
p Map strings to and from integer IDs.
|
|
|
|
+h(2, "init") StringStore.__init__
|
|
+tag method
|
|
|
|
p Create the #[code StringStore].
|
|
|
|
+table(["Name", "Type", "Description"])
|
|
+row
|
|
+cell #[code strings]
|
|
+cell -
|
|
+cell A sequence of unicode strings to add to the store.
|
|
|
|
+footrow
|
|
+cell returns
|
|
+cell #[code StringStore]
|
|
+cell The newly constructed object.
|
|
|
|
+h(2, "len") StringStore.__len__
|
|
+tag method
|
|
|
|
p Get the number of strings in the store.
|
|
|
|
+table(["Name", "Type", "Description"])
|
|
+footrow
|
|
+cell returns
|
|
+cell int
|
|
+cell The number of strings in the store.
|
|
|
|
+h(2, "getitem") StringStore.__getitem__
|
|
+tag method
|
|
|
|
p Retrieve a string from a given integer ID, or vice versa.
|
|
|
|
+table(["Name", "Type", "Description"])
|
|
+row
|
|
+cell #[code string_or_id]
|
|
+cell bytes / unicode / int
|
|
+cell The value to encode.
|
|
|
|
+footrow
|
|
+cell returns
|
|
+cell unicode / int
|
|
+cell The value to retrieved.
|
|
|
|
+h(2, "contains") StringStore.__contains__
|
|
+tag method
|
|
|
|
p Check whether a string is in the store.
|
|
|
|
+table(["Name", "Type", "Description"])
|
|
+row
|
|
+cell #[code string]
|
|
+cell unicode
|
|
+cell The string to check.
|
|
|
|
+footrow
|
|
+cell returns
|
|
+cell bool
|
|
+cell Whether the store contains the string.
|
|
|
|
+h(2, "iter") StringStore.__iter__
|
|
+tag method
|
|
|
|
p Iterate over the strings in the store, in order.
|
|
|
|
+table(["Name", "Type", "Description"])
|
|
+footrow
|
|
+cell yields
|
|
+cell unicode
|
|
+cell A string in the store.
|