2016-12-08 18:46:43 +00:00
|
|
|
|
# encoding: utf8
|
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TOKENIZER_PREFIXES = r'''
|
|
|
|
|
,
|
|
|
|
|
"
|
|
|
|
|
(
|
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
*
|
|
|
|
|
<
|
|
|
|
|
>
|
|
|
|
|
$
|
|
|
|
|
£
|
|
|
|
|
¡
|
|
|
|
|
¿
|
|
|
|
|
„
|
|
|
|
|
“
|
|
|
|
|
'
|
|
|
|
|
``
|
|
|
|
|
`
|
|
|
|
|
#
|
|
|
|
|
‘
|
|
|
|
|
....
|
|
|
|
|
...
|
|
|
|
|
…
|
|
|
|
|
‚
|
|
|
|
|
»
|
|
|
|
|
§
|
|
|
|
|
US$
|
|
|
|
|
C$
|
|
|
|
|
A$
|
|
|
|
|
a-
|
|
|
|
|
'''.strip().split('\n')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TOKENIZER_SUFFIXES = r'''
|
|
|
|
|
,
|
|
|
|
|
\"
|
|
|
|
|
\)
|
|
|
|
|
\]
|
|
|
|
|
\}
|
|
|
|
|
\*
|
|
|
|
|
\!
|
|
|
|
|
\?
|
|
|
|
|
%
|
|
|
|
|
\$
|
|
|
|
|
>
|
|
|
|
|
:
|
|
|
|
|
;
|
|
|
|
|
'
|
|
|
|
|
”
|
|
|
|
|
“
|
|
|
|
|
«
|
|
|
|
|
_
|
|
|
|
|
''
|
|
|
|
|
's
|
|
|
|
|
'S
|
|
|
|
|
’s
|
|
|
|
|
’S
|
|
|
|
|
’
|
|
|
|
|
‘
|
|
|
|
|
°
|
|
|
|
|
€
|
|
|
|
|
…
|
|
|
|
|
\.\.
|
|
|
|
|
\.\.\.
|
|
|
|
|
\.\.\.\.
|
|
|
|
|
(?<=[a-z0-9)\]”"'%\)])\.
|
|
|
|
|
(?<=[a-zäöüßÖÄÜ)\]"'´«‘’%\)²“”])\.
|
|
|
|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[A-Z])
|
|
|
|
|
(?<=[a-z])\.(?=[A-Z])
|
|
|
|
|
(?<=[a-zA-Z])-(?=[a-zA-z])
|
|
|
|
|
(?<=[a-zA-Z])--(?=[a-zA-z])
|
|
|
|
|
(?<=[0-9])-(?=[0-9])
|
|
|
|
|
(?<=[A-Za-z]),(?=[A-Za-z])
|
|
|
|
|
(?<=[a-zöäüßA-ZÖÄÜ"]):(?=[a-zöäüßA-ZÖÄÜ])
|
|
|
|
|
(?<=[a-zöäüßA-ZÖÄÜ"])>(?=[a-zöäüßA-ZÖÄÜ])
|
|
|
|
|
(?<=[a-zöäüßA-ZÖÄÜ"])<(?=[a-zöäüßA-ZÖÄÜ])
|
|
|
|
|
(?<=[a-zöäüßA-ZÖÄÜ"])=(?=[a-zöäüßA-ZÖÄÜ])
|
|
|
|
|
'''.strip().split('\n')
|
|
|
|
|
|
|
|
|
|
|
2016-12-18 14:35:56 +00:00
|
|
|
|
__all__ = ["TOKENIZER_PREFIXES", "TOKENIZER_SUFFIXES", "TOKENIZER_INFIXES"]
|