2020-07-22 23:18:46 +03:00
|
|
|
|
from ..tokenizer_exceptions import BASE_EXCEPTIONS
|
2020-07-23 00:09:01 +03:00
|
|
|
|
from ...symbols import ORTH, NORM
|
2020-07-22 23:18:46 +03:00
|
|
|
|
from ...util import update_exc
|
|
|
|
|
|
2019-10-14 13:27:50 +03:00
|
|
|
|
|
|
|
|
|
# TODO
|
|
|
|
|
# treat other apostrophes within words as part of the word: [op d'mannst], [fir d'éischt] (= exceptions)
|
|
|
|
|
|
2019-11-20 15:15:24 +03:00
|
|
|
|
_exc = {}
|
2019-10-14 13:27:50 +03:00
|
|
|
|
|
|
|
|
|
# translate / delete what is not necessary
|
|
|
|
|
for exc_data in [
|
2020-07-23 00:09:01 +03:00
|
|
|
|
{ORTH: "’t", NORM: "et"},
|
|
|
|
|
{ORTH: "’T", NORM: "et"},
|
|
|
|
|
{ORTH: "'t", NORM: "et"},
|
|
|
|
|
{ORTH: "'T", NORM: "et"},
|
|
|
|
|
{ORTH: "wgl.", NORM: "wannechgelift"},
|
|
|
|
|
{ORTH: "M.", NORM: "Monsieur"},
|
|
|
|
|
{ORTH: "Mme.", NORM: "Madame"},
|
|
|
|
|
{ORTH: "Dr.", NORM: "Dokter"},
|
|
|
|
|
{ORTH: "Tel.", NORM: "Telefon"},
|
|
|
|
|
{ORTH: "asw.", NORM: "an sou weider"},
|
|
|
|
|
{ORTH: "etc.", NORM: "et cetera"},
|
|
|
|
|
{ORTH: "bzw.", NORM: "bezéiungsweis"},
|
|
|
|
|
{ORTH: "Jan.", NORM: "Januar"},
|
2019-10-18 12:27:38 +03:00
|
|
|
|
]:
|
2019-10-14 13:27:50 +03:00
|
|
|
|
_exc[exc_data[ORTH]] = [exc_data]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# to be extended
|
|
|
|
|
for orth in [
|
2019-10-18 12:27:38 +03:00
|
|
|
|
"z.B.",
|
|
|
|
|
"Dipl.",
|
|
|
|
|
"Dr.",
|
|
|
|
|
"etc.",
|
|
|
|
|
"i.e.",
|
|
|
|
|
"o.k.",
|
|
|
|
|
"O.K.",
|
|
|
|
|
"p.a.",
|
|
|
|
|
"p.s.",
|
|
|
|
|
"P.S.",
|
|
|
|
|
"phil.",
|
|
|
|
|
"q.e.d.",
|
|
|
|
|
"R.I.P.",
|
|
|
|
|
"rer.",
|
|
|
|
|
"sen.",
|
|
|
|
|
"ë.a.",
|
|
|
|
|
"U.S.",
|
|
|
|
|
"U.S.A.",
|
|
|
|
|
]:
|
2019-10-14 13:27:50 +03:00
|
|
|
|
_exc[orth] = [{ORTH: orth}]
|
|
|
|
|
|
2020-07-22 23:18:46 +03:00
|
|
|
|
TOKENIZER_EXCEPTIONS = update_exc(BASE_EXCEPTIONS, _exc)
|