|
4 | 4 | re_emoji = re.compile('[' # lgtm[py/overly-large-range] |
5 | 5 | '\U0001F300-\U0001F64F' |
6 | 6 | '\U0001F680-\U0001F6FF' |
7 | | - '\u2600-\u26FF\u2700-\u27BF]+', |
8 | | - re.UNICODE) |
| 7 | + '\u2600-\u26FF\u2700-\u27BF]+') |
9 | 8 |
|
10 | 9 | EMPTY_REGEX = re.compile('') |
11 | 10 |
|
12 | 11 | REGEXES = set([ |
13 | | - ("spaces", re.compile(r"\s+", re.U)), |
14 | | - ("word", re.compile(r"(\w|\.)+", re.U)), |
15 | | - ("mac", re.compile(r'^(ma?c)(\w{2,})', re.I | re.U)), |
16 | | - ("initial", re.compile(r'^(\w\.|[A-Z])?$', re.U)), |
17 | | - ("quoted_word", re.compile(r'(?<!\w)\'([^\s]*?)\'(?!\w)', re.U)), |
18 | | - ("double_quotes", re.compile(r'\"(.*?)\"', re.U)), |
19 | | - ("parenthesis", re.compile(r'\((.*?)\)', re.U)), |
20 | | - ("roman_numeral", re.compile(r'^(X|IX|IV|V?I{0,3})$', re.I | re.U)), |
21 | | - ("no_vowels",re.compile(r'^[^aeyiuo]+$', re.I | re.U)), |
22 | | - ("period_not_at_end",re.compile(r'.*\..+$', re.I | re.U)), |
| 12 | + ("spaces", re.compile(r"\s+")), |
| 13 | + ("word", re.compile(r"(\w|\.)+")), |
| 14 | + ("mac", re.compile(r'^(ma?c)(\w{2,})', re.I)), |
| 15 | + ("initial", re.compile(r'^(\w\.|[A-Z])?$')), |
| 16 | + ("quoted_word", re.compile(r'(?<!\w)\'([^\s]*?)\'(?!\w)')), |
| 17 | + ("double_quotes", re.compile(r'\"(.*?)\"')), |
| 18 | + ("parenthesis", re.compile(r'\((.*?)\)')), |
| 19 | + ("roman_numeral", re.compile(r'^(X|IX|IV|V?I{0,3})$', re.I)), |
| 20 | + ("no_vowels",re.compile(r'^[^aeyiuo]+$', re.I)), |
| 21 | + ("period_not_at_end",re.compile(r'.*\..+$', re.I)), |
23 | 22 | ("emoji",re_emoji), |
24 | | - ("phd", re.compile(r'\s(ph\.?\s+d\.?)', re.I | re.U)), |
25 | | - ("space_before_comma", re.compile(r'\s+,', re.U)), |
| 23 | + ("phd", re.compile(r'\s(ph\.?\s+d\.?)', re.I)), |
| 24 | + ("space_before_comma", re.compile(r'\s+,')), |
26 | 25 | ("patronymic", re.compile( |
27 | 26 | r'(ovich|ovna|evich|evna|ichna|ilyich|kuzmich|lukich|fomich|fokich)$', |
28 | | - re.I | re.U, |
| 27 | + re.I, |
29 | 28 | )), |
30 | 29 | ("patronymic_cyrillic", re.compile( |
31 | 30 | r'(ович|овна|евич|евна|ична|ильич|кузьмич|лукич|фомич|фокич)$', |
32 | | - re.U, |
33 | 31 | )), |
34 | | - ("period_abbreviation", re.compile(r'^[^\W\d_]{2,}\.$', re.U)), |
| 32 | + ("period_abbreviation", re.compile(r'^[^\W\d_]{2,}\.$')), |
35 | 33 | ]) |
36 | 34 | """ |
37 | 35 | All regular expressions used by the parser are precompiled and stored in the config. |
|
0 commit comments