mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 17:06:29 +03:00
Adding method lemmatizer for every class
This commit is contained in:
parent
32ca07989e
commit
0e8c41ea4f
|
@ -7,6 +7,8 @@ from ..language import Language
|
|||
from ..attrs import LANG
|
||||
|
||||
from .language_data import *
|
||||
from ..lemmatizerlookup import Lemmatizer
|
||||
from .lemmatization import LOOK_UP
|
||||
|
||||
|
||||
class German(Language):
|
||||
|
@ -21,5 +23,9 @@ class German(Language):
|
|||
tag_map = TAG_MAP
|
||||
stop_words = STOP_WORDS
|
||||
|
||||
@classmethod
|
||||
def create_lemmatizer(cls, nlp=None):
|
||||
return Lemmatizer(LOOK_UP)
|
||||
|
||||
|
||||
EXPORT = German
|
|
@ -7,7 +7,8 @@ from ..language import Language
|
|||
from ..attrs import LANG
|
||||
|
||||
from .language_data import *
|
||||
|
||||
from ..lemmatizerlookup import Lemmatizer
|
||||
from .lemmatization import LOOK_UP
|
||||
|
||||
class Spanish(Language):
|
||||
lang = 'es'
|
||||
|
@ -21,4 +22,5 @@ class Spanish(Language):
|
|||
stop_words = STOP_WORDS
|
||||
|
||||
|
||||
|
||||
EXPORT = Spanish
|
|
@ -5,7 +5,8 @@ from .tokenizer_exceptions import TOKEN_MATCH
|
|||
from .language_data import *
|
||||
from ..attrs import LANG
|
||||
from ..language import Language
|
||||
|
||||
from ..lemmatizerlookup import Lemmatizer
|
||||
from .lemmatization import LOOK_UP
|
||||
|
||||
class Hungarian(Language):
|
||||
lang = 'hu'
|
||||
|
@ -25,5 +26,9 @@ class Hungarian(Language):
|
|||
|
||||
token_match = TOKEN_MATCH
|
||||
|
||||
@classmethod
|
||||
def create_lemmatizer(cls, nlp=None):
|
||||
return Lemmatizer(LOOK_UP)
|
||||
|
||||
|
||||
EXPORT = Hungarian
|
|
@ -5,7 +5,8 @@ from ..language import Language
|
|||
from ..attrs import LANG
|
||||
|
||||
from .language_data import *
|
||||
|
||||
from ..lemmatizerlookup import Lemmatizer
|
||||
from .lemmatization import LOOK_UP
|
||||
|
||||
class Italian(Language):
|
||||
lang = 'it'
|
||||
|
@ -17,5 +18,10 @@ class Italian(Language):
|
|||
tokenizer_exceptions = TOKENIZER_EXCEPTIONS
|
||||
stop_words = STOP_WORDS
|
||||
|
||||
@classmethod
|
||||
def create_lemmatizer(cls, nlp=None):
|
||||
return Lemmatizer(LOOK_UP)
|
||||
|
||||
|
||||
|
||||
EXPORT = Italian
|
|
@ -5,7 +5,8 @@ from ..language import Language
|
|||
from ..attrs import LANG
|
||||
|
||||
from .language_data import *
|
||||
|
||||
from ..lemmatizerlookup import Lemmatizer
|
||||
from .lemmatization import LOOK_UP
|
||||
|
||||
class Portuguese(Language):
|
||||
lang = 'pt'
|
||||
|
@ -17,5 +18,9 @@ class Portuguese(Language):
|
|||
tokenizer_exceptions = TOKENIZER_EXCEPTIONS
|
||||
stop_words = STOP_WORDS
|
||||
|
||||
@classmethod
|
||||
def create_lemmatizer(cls, nlp=None):
|
||||
return Lemmatizer(LOOK_UP)
|
||||
|
||||
|
||||
EXPORT = Portuguese
|
|
@ -4,7 +4,8 @@ from __future__ import unicode_literals, print_function
|
|||
from ..language import Language
|
||||
from ..attrs import LANG
|
||||
from .language_data import *
|
||||
|
||||
from ..lemmatizerlookup import Lemmatizer
|
||||
from .lemmatization import LOOK_UP
|
||||
|
||||
class Swedish(Language):
|
||||
lang = 'sv'
|
||||
|
@ -16,5 +17,9 @@ class Swedish(Language):
|
|||
tokenizer_exceptions = TOKENIZER_EXCEPTIONS
|
||||
stop_words = STOP_WORDS
|
||||
|
||||
@classmethod
|
||||
def create_lemmatizer(cls, nlp=None):
|
||||
return Lemmatizer(LOOK_UP)
|
||||
|
||||
|
||||
EXPORT = Swedish
|
Loading…
Reference in New Issue
Block a user