mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 09:26:27 +03:00
Format
This commit is contained in:
parent
18205c6c48
commit
2499da97e8
|
@ -1,4 +1,6 @@
|
|||
# import language-specific data
|
||||
# coding: utf8
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .stop_words import STOP_WORDS
|
||||
from .lex_attrs import LEX_ATTRS
|
||||
|
||||
|
@ -7,20 +9,16 @@ from ...language import Language
|
|||
from ...attrs import LANG
|
||||
from ...util import update_exc
|
||||
|
||||
# create Defaults class in the module scope (necessary for pickling!)
|
||||
|
||||
class TamilDefaults(Language.Defaults):
|
||||
lex_attr_getters = dict(Language.Defaults.lex_attr_getters)
|
||||
lex_attr_getters[LANG] = lambda text: "ta" # language ISO code
|
||||
|
||||
# optional: replace flags with custom functions, e.g. like_num()
|
||||
lex_attr_getters[LANG] = lambda text: "ta"
|
||||
lex_attr_getters.update(LEX_ATTRS)
|
||||
|
||||
|
||||
# create actual Language class
|
||||
class Tamil(Language):
|
||||
lang = "ta" # language ISO code
|
||||
Defaults = TamilDefaults # override defaults
|
||||
lang = "ta"
|
||||
Defaults = TamilDefaults
|
||||
|
||||
|
||||
# set default export – this allows the language class to be lazy-loaded
|
||||
__all__ = ["Tamil"]
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# coding: utf8
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from ...attrs import LIKE_NUM
|
||||
|
||||
|
||||
|
@ -81,4 +82,5 @@ def like_num(text):
|
|||
|
||||
return False
|
||||
|
||||
|
||||
LEX_ATTRS = {LIKE_NUM: like_num}
|
||||
|
|
Loading…
Reference in New Issue
Block a user