|
50 | 50 |
|
51 | 51 | import ast |
52 | 52 | import re |
| 53 | +from typing import Dict, Union |
| 54 | + |
53 | 55 |
|
54 | 56 | try: |
55 | | - import importlib.metadata as importlib_metadata |
| 57 | + import importlib.metadata as importlib_metadata # type: ignore |
56 | 58 | except ImportError: |
57 | | - import importlib_metadata |
| 59 | + import importlib_metadata # type: ignore |
58 | 60 |
|
59 | 61 |
|
60 | 62 | class UnknownClassicalModeError(Exception): |
@@ -1456,16 +1458,16 @@ def make_pl_si_lists(lst, plending, siendingsize, dojoinstem=True): |
1456 | 1458 | ) |
1457 | 1459 | ) |
1458 | 1460 |
|
1459 | | -pl_sb_postfix_adj = { |
| 1461 | +_pl_sb_postfix_adj_defn = { |
1460 | 1462 | "general": [r"(?!major|lieutenant|brigadier|adjutant|.*star)\S+"], |
1461 | 1463 | "martial": ["court"], |
1462 | 1464 | "force": ["pound"], |
1463 | 1465 | } |
1464 | 1466 |
|
1465 | | -for k in list(pl_sb_postfix_adj.keys()): |
1466 | | - pl_sb_postfix_adj[k] = enclose( |
1467 | | - enclose("|".join(pl_sb_postfix_adj[k])) + "(?=(?:-|\\s+)%s)" % k |
1468 | | - ) |
| 1467 | +pl_sb_postfix_adj: Dict[str, str] = {} |
| 1468 | + |
| 1469 | +for key, val in _pl_sb_postfix_adj_defn.items(): |
| 1470 | + pl_sb_postfix_adj[key] = enclose(enclose("|".join(val)) + "(?=(?:-|\\s+)%s)" % key) |
1469 | 1471 |
|
1470 | 1472 | pl_sb_postfix_adj_stems = "(" + "|".join(list(pl_sb_postfix_adj.values())) + ")(.*)" |
1471 | 1473 |
|
@@ -1590,7 +1592,7 @@ def make_pl_si_lists(lst, plending, siendingsize, dojoinstem=True): |
1590 | 1592 | "theirs": "theirs", |
1591 | 1593 | } |
1592 | 1594 |
|
1593 | | -si_pron = {} |
| 1595 | +si_pron: Dict[str, Dict[str, Union[str, Dict[str, str]]]] = {} |
1594 | 1596 | si_pron["nom"] = {v: k for (k, v) in pl_pron_nom.items()} |
1595 | 1597 | si_pron["nom"]["we"] = "I" |
1596 | 1598 |
|
@@ -1649,10 +1651,10 @@ def make_pl_si_lists(lst, plending, siendingsize, dojoinstem=True): |
1649 | 1651 | ("acc", "themselves", "masculine or feminine", "himself or herself"), |
1650 | 1652 | ): |
1651 | 1653 | try: |
1652 | | - si_pron[thecase][plur][gend] = sing |
| 1654 | + si_pron[thecase][plur][gend] = sing # type: ignore |
1653 | 1655 | except TypeError: |
1654 | 1656 | si_pron[thecase][plur] = {} |
1655 | | - si_pron[thecase][plur][gend] = sing |
| 1657 | + si_pron[thecase][plur][gend] = sing # type: ignore |
1656 | 1658 |
|
1657 | 1659 |
|
1658 | 1660 | si_pron_acc_keys = enclose("|".join(list(si_pron["acc"].keys()))) |
|
0 commit comments