mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-26 01:04:34 +03:00
Update docs on adding lemmatization to languages
This commit is contained in:
parent
453c47ca24
commit
eac9e99086
|
@ -456,24 +456,11 @@ p
|
||||||
}
|
}
|
||||||
|
|
||||||
p
|
p
|
||||||
| To add a lookup lemmatizer to your language, import the #[code LOOKUP]
|
| To provide a lookup lemmatizer for your language, import the lookup table
|
||||||
| table and #[code Lemmatizer], and create a new classmethod:
|
| and add it to the #[code Language] class as #[code lemma_lookup]:
|
||||||
|
|
||||||
|
+code.
|
||||||
+code("__init__py (excerpt)").
|
lemma_lookup = dict(LOOKUP)
|
||||||
# other imports here, plus lookup table and lookup lemmatizer
|
|
||||||
from .lemmatizer import LOOKUP
|
|
||||||
from ...lemmatizerlookup import Lemmatizer
|
|
||||||
|
|
||||||
class Xxxxx(Language):
|
|
||||||
lang = 'xx'
|
|
||||||
|
|
||||||
class Defaults(Language.Defaults):
|
|
||||||
# other language defaults here
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def create_lemmatizer(cls, nlp=None):
|
|
||||||
return Lemmatizer(LOOKUP)
|
|
||||||
|
|
||||||
+h(3, "tag-map") Tag map
|
+h(3, "tag-map") Tag map
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user