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 .stop_words import STOP_WORDS
|
||||||
from .lex_attrs import LEX_ATTRS
|
from .lex_attrs import LEX_ATTRS
|
||||||
|
|
||||||
|
@ -7,20 +9,16 @@ from ...language import Language
|
||||||
from ...attrs import LANG
|
from ...attrs import LANG
|
||||||
from ...util import update_exc
|
from ...util import update_exc
|
||||||
|
|
||||||
# create Defaults class in the module scope (necessary for pickling!)
|
|
||||||
class TamilDefaults(Language.Defaults):
|
class TamilDefaults(Language.Defaults):
|
||||||
lex_attr_getters = dict(Language.Defaults.lex_attr_getters)
|
lex_attr_getters = dict(Language.Defaults.lex_attr_getters)
|
||||||
lex_attr_getters[LANG] = lambda text: "ta" # language ISO code
|
lex_attr_getters[LANG] = lambda text: "ta"
|
||||||
|
|
||||||
# optional: replace flags with custom functions, e.g. like_num()
|
|
||||||
lex_attr_getters.update(LEX_ATTRS)
|
lex_attr_getters.update(LEX_ATTRS)
|
||||||
|
|
||||||
|
|
||||||
# create actual Language class
|
|
||||||
class Tamil(Language):
|
class Tamil(Language):
|
||||||
lang = "ta" # language ISO code
|
lang = "ta"
|
||||||
Defaults = TamilDefaults # override defaults
|
Defaults = TamilDefaults
|
||||||
|
|
||||||
|
|
||||||
# set default export – this allows the language class to be lazy-loaded
|
|
||||||
__all__ = ["Tamil"]
|
__all__ = ["Tamil"]
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# coding: utf8
|
# coding: utf8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from ...attrs import LIKE_NUM
|
from ...attrs import LIKE_NUM
|
||||||
|
|
||||||
|
|
||||||
|
@ -81,4 +82,5 @@ def like_num(text):
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
LEX_ATTRS = {LIKE_NUM: like_num}
|
LEX_ATTRS = {LIKE_NUM: like_num}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user