mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Better error handling
This commit is contained in:
parent
b03a46792c
commit
b4df202bfa
|
@ -2,7 +2,7 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from ..language_data.punctuation import ALPHA_LOWER, LIST_ELLIPSES, QUOTES, ALPHA_UPPER, LIST_QUOTES, UNITS, \
|
||||
CURRENCY, LIST_PUNCT, ALPHA
|
||||
CURRENCY, LIST_PUNCT, ALPHA, _QUOTES
|
||||
|
||||
CURRENCY_SYMBOLS = r"\$ ¢ £ € ¥ ฿"
|
||||
|
||||
|
@ -35,7 +35,7 @@ TOKENIZER_INFIXES = (
|
|||
r'(?<=[{a}"])[:<>=](?=[{a}])'.format(a=ALPHA),
|
||||
r'(?<=[{a}])--(?=[{a}])'.format(a=ALPHA),
|
||||
r'(?<=[{a}]),(?=[{a}])'.format(a=ALPHA),
|
||||
r'(?<=[{a}])(({q})|[\)\]\(\[])(?=[\-{a}])'.format(a=ALPHA, q=QUOTES),
|
||||
r'(?<=[{a}])([{q}\)\]\(\[])(?=[\-{a}])'.format(a=ALPHA, q=_QUOTES.replace("'", "").strip().replace(" ", "")),
|
||||
]
|
||||
)
|
||||
__all__ = ["TOKENIZER_PREFIXES", "TOKENIZER_SUFFIXES", "TOKENIZER_INFIXES"]
|
||||
|
|
|
@ -63,7 +63,6 @@ EU.
|
|||
F.
|
||||
Fla.
|
||||
Folyt.
|
||||
Ford.
|
||||
Fpk.
|
||||
Főszerk.
|
||||
G.
|
||||
|
@ -184,7 +183,6 @@ Ty.
|
|||
Tyr.
|
||||
U.
|
||||
Ui.
|
||||
User.
|
||||
Ut.
|
||||
V.
|
||||
VB.
|
||||
|
@ -261,7 +259,6 @@ ea.
|
|||
ed.
|
||||
eff.
|
||||
egyh.
|
||||
el.
|
||||
ell.
|
||||
elv.
|
||||
elvt.
|
||||
|
@ -349,7 +346,7 @@ io.
|
|||
ip.
|
||||
ir.
|
||||
irod.
|
||||
is.
|
||||
irod.
|
||||
isk.
|
||||
ism.
|
||||
izr.
|
||||
|
@ -604,7 +601,6 @@ zs.
|
|||
ált.
|
||||
ápr.
|
||||
ásv.
|
||||
át.
|
||||
é.
|
||||
ék.
|
||||
ény.
|
||||
|
|
|
@ -36,6 +36,7 @@ HYPHEN_TESTS = [
|
|||
('Lakik-e... van.', ['Lakik', '-e', '...', 'van', '.']),
|
||||
('Lakik-e van?', ['Lakik', '-e', 'van', '?']),
|
||||
('Lakik-elem van?', ['Lakik-elem', 'van', '?']),
|
||||
('Az életbiztosításáról- egy.', ['Az', 'életbiztosításáról-', 'egy', '.']),
|
||||
('Van lakik-elem.', ['Van', 'lakik-elem', '.']),
|
||||
('A 7-es busz?', ['A', '7-es', 'busz', '?']),
|
||||
('A 7-es?', ['A', '7-es', '?']),
|
||||
|
@ -218,7 +219,7 @@ QUOTE_TESTS = [
|
|||
('"Ime, hat"-ban irja.', ['"', 'Ime', ',', 'hat', '"', '-ban', 'irja', '.']),
|
||||
('Az "Ime, hat".', ['Az', '"', 'Ime', ',', 'hat', '"', '.']),
|
||||
('Egy 24"-os monitor.', ['Egy', '24"-os', 'monitor', '.']),
|
||||
# ("A don't van.", ['A', "don't", 'van', '.'])
|
||||
("A McDonald's van.", ['A', "McDonald's", 'van', '.'])
|
||||
]
|
||||
|
||||
DOT_TESTS = [
|
||||
|
|
Loading…
Reference in New Issue
Block a user