-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
70c0a5f
commit 57aba99
Showing
9 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,5 @@ dist/ | |
htmlcov/ | ||
.tox/ | ||
build/ | ||
.mypy_cache/ | ||
.venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[mypy] | ||
incremental = True | ||
warn_unused_configs = True | ||
disallow_any_generics = True | ||
disallow_subclassing_any = True | ||
disallow_untyped_calls = True | ||
disallow_untyped_defs = True | ||
disallow_incomplete_defs = True | ||
check_untyped_defs = True | ||
disallow_untyped_decorators = True | ||
no_implicit_optional = True | ||
warn_redundant_casts = True | ||
warn_unused_ignores = True | ||
warn_return_any = True | ||
no_implicit_reexport = True | ||
disallow_any_unimported = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .collator import Collator as Collator # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import sys | ||
from typing import List, Optional, Tuple, ClassVar | ||
from .trie import Trie | ||
|
||
class BaseCollator: | ||
CJK_IDEOGRAPHS_8_0_0: ClassVar[bool] = ... | ||
CJK_IDEOGRAPHS_10_0_0: ClassVar[bool] = ... | ||
CJK_IDEOGRAPHS_EXT_A: ClassVar[bool] = ... | ||
CJK_IDEOGRAPHS_EXT_B: ClassVar[bool] = ... | ||
CJK_IDEOGRAPHS_EXT_C: ClassVar[bool] = ... | ||
CJK_IDEOGRAPHS_EXT_D: ClassVar[bool] = ... | ||
CJK_IDEOGRAPHS_EXT_E: ClassVar[bool] = ... | ||
CJK_IDEOGRAPHS_EXT_F: ClassVar[bool] = ... | ||
table: Trie | ||
implicit_weights: List[List[int]] = ... | ||
def __init__(self, filename: Optional[str] = ...) -> None: ... | ||
def load(self, filename: str) -> None: ... | ||
def collation_elements( | ||
self, | ||
normalized_string: str | ||
) -> List[List[int]]: ... | ||
def sort_key_from_collation_elements( | ||
self, | ||
collation_elements: List[List[int]] | ||
) -> Tuple[int, ...]: ... | ||
def sort_key(self, string: str) -> Tuple[int, ...]: ... | ||
def implicit_weight(self, cp: int) -> List[List[int]]: ... | ||
def build_lookup_key(self, text: str) -> List[int]: ... | ||
|
||
class Collator_6_3_0(BaseCollator): | ||
UCA_VERSION: ClassVar[str] = ... | ||
|
||
class Collator_8_0_0(BaseCollator): | ||
UCA_VERSION: ClassVar[str] = ... | ||
CJK_IDEOGRAPHS_8_0_0: ClassVar[bool] = ... | ||
CJK_IDEOGRAPHS_EXT_E: ClassVar[bool] = ... | ||
|
||
class Collator_9_0_0(BaseCollator): | ||
UCA_VERSION: ClassVar[str] = ... | ||
CJK_IDEOGRAPHS_8_0_0: ClassVar[bool] = ... | ||
CJK_IDEOGRAPHS_EXT_E: ClassVar[bool] = ... | ||
|
||
class Collator_10_0_0(BaseCollator): | ||
UCA_VERSION: ClassVar[str] = ... | ||
CJK_IDEOGRAPHS_8_0_0: ClassVar[bool] = ... | ||
CJK_IDEOGRAPHS_10_0_0: ClassVar[bool] = ... | ||
CJK_IDEOGRAPHS_EXT_E: ClassVar[bool] = ... | ||
CJK_IDEOGRAPHS_EXT_F: ClassVar[bool] = ... | ||
|
||
class Collator_5_2_0(BaseCollator): | ||
UCA_VERSION: ClassVar[str] = ... | ||
CJK_IDEOGRAPHS_EXT_C: ClassVar[bool] = ... | ||
CJK_IDEOGRAPHS_EXT_D: ClassVar[bool] = ... | ||
non_char_code_points: ClassVar[List[int]] = ... | ||
def build_lookup_key(self, text: str) -> List[int]: ... | ||
|
||
if sys.version_info < (3,): | ||
Collator = Collator_5_2_0 | ||
elif sys.version_info[:2] == (3, 5): | ||
Collator = Collator_8_0_0 | ||
elif sys.version_info[:2] >= (3, 6): | ||
Collator = Collator_9_0_0 | ||
else: | ||
Collator = Collator_6_3_0 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from typing import List, Optional, Tuple, Dict | ||
|
||
class Node: | ||
value: Optional[List[List[int]]] | ||
children: Optional[Dict[int, Node]] | ||
def __init__(self) -> None: ... | ||
|
||
class Trie: | ||
root: Node | ||
def __init__(self) -> None: ... | ||
def add(self, key: List[int], value: List[List[int]]) -> None: ... | ||
def find_prefix( | ||
self, | ||
key: List[int] | ||
) -> Tuple[List[int], Optional[List[List[int]]], List[int]]: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from typing import Iterable, List, Optional | ||
|
||
def hexstrings2int(hexstrings: Iterable[str]) -> List[int]: ... | ||
def int2hexstrings(number_list: Iterable[int]) -> List[str]: ... | ||
def format_collation_elements( | ||
collation_elements: Optional[List[List[int]]] | ||
) -> Optional[str]: ... | ||
def format_sort_key(sort_key: List[int]) -> str: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters