character-encoding-utils 0.0.3__tar.gz → 0.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {character-encoding-utils-0.0.3 → character-encoding-utils-0.0.4}/PKG-INFO +1 -1
- {character-encoding-utils-0.0.3 → character-encoding-utils-0.0.4}/pyproject.toml +1 -1
- {character-encoding-utils-0.0.3 → character-encoding-utils-0.0.4}/src/character_encoding_utils/big5.py +1 -1
- {character-encoding-utils-0.0.3 → character-encoding-utils-0.0.4}/src/character_encoding_utils/gb2312.py +2 -2
- {character-encoding-utils-0.0.3 → character-encoding-utils-0.0.4}/src/character_encoding_utils/ksx1001.py +2 -2
- {character-encoding-utils-0.0.3 → character-encoding-utils-0.0.4}/src/character_encoding_utils/shiftjis.py +2 -2
- {character-encoding-utils-0.0.3 → character-encoding-utils-0.0.4}/src/character_encoding_utils.egg-info/PKG-INFO +1 -1
- {character-encoding-utils-0.0.3 → character-encoding-utils-0.0.4}/LICENSE +0 -0
- {character-encoding-utils-0.0.3 → character-encoding-utils-0.0.4}/README.md +0 -0
- {character-encoding-utils-0.0.3 → character-encoding-utils-0.0.4}/setup.cfg +0 -0
- {character-encoding-utils-0.0.3 → character-encoding-utils-0.0.4}/src/character_encoding_utils/__init__.py +0 -0
- {character-encoding-utils-0.0.3 → character-encoding-utils-0.0.4}/src/character_encoding_utils.egg-info/SOURCES.txt +0 -0
- {character-encoding-utils-0.0.3 → character-encoding-utils-0.0.4}/src/character_encoding_utils.egg-info/dependency_links.txt +0 -0
- {character-encoding-utils-0.0.3 → character-encoding-utils-0.0.4}/src/character_encoding_utils.egg-info/top_level.txt +0 -0
- {character-encoding-utils-0.0.3 → character-encoding-utils-0.0.4}/tests/test_big5.py +0 -0
- {character-encoding-utils-0.0.3 → character-encoding-utils-0.0.4}/tests/test_gb2312.py +0 -0
- {character-encoding-utils-0.0.3 → character-encoding-utils-0.0.4}/tests/test_ksx1001.py +0 -0
- {character-encoding-utils-0.0.3 → character-encoding-utils-0.0.4}/tests/test_shiftjis.py +0 -0
|
@@ -98,7 +98,7 @@ def decode(bs: bytes | bytearray) -> str:
|
|
|
98
98
|
|
|
99
99
|
def query_code(c: str) -> int:
|
|
100
100
|
if len(c) != 1:
|
|
101
|
-
raise Big5Exception('
|
|
101
|
+
raise Big5Exception('Must be one character')
|
|
102
102
|
try:
|
|
103
103
|
bs = encode(c)
|
|
104
104
|
except Big5EncodeError as e:
|
|
@@ -60,7 +60,7 @@ def decode(bs: bytes | bytearray) -> str:
|
|
|
60
60
|
|
|
61
61
|
def query_coord(c: str) -> tuple[int, int]:
|
|
62
62
|
if len(c) != 1:
|
|
63
|
-
raise GB2312Exception('
|
|
63
|
+
raise GB2312Exception('Must be one character')
|
|
64
64
|
try:
|
|
65
65
|
bs = encode(c)
|
|
66
66
|
except GB2312EncodeError as e:
|
|
@@ -97,7 +97,7 @@ def query_category(c: str) -> str | None:
|
|
|
97
97
|
elif 56 <= row <= 87:
|
|
98
98
|
return 'level-2'
|
|
99
99
|
else:
|
|
100
|
-
|
|
100
|
+
return None
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
def _build_alphabet_by_rows_between(row_start: int, row_end: int) -> list[str]:
|
|
@@ -74,7 +74,7 @@ def decode(bs: bytes | bytearray) -> str:
|
|
|
74
74
|
|
|
75
75
|
def query_coord(c: str) -> tuple[int, int]:
|
|
76
76
|
if len(c) != 1:
|
|
77
|
-
raise KSX1001Exception('
|
|
77
|
+
raise KSX1001Exception('Must be one character')
|
|
78
78
|
try:
|
|
79
79
|
bs = encode(c)
|
|
80
80
|
except KSX1001EncodeError as e:
|
|
@@ -113,7 +113,7 @@ def query_category(c: str) -> str | None:
|
|
|
113
113
|
elif 42 <= row <= 93:
|
|
114
114
|
return 'hanja'
|
|
115
115
|
else:
|
|
116
|
-
|
|
116
|
+
return None
|
|
117
117
|
|
|
118
118
|
|
|
119
119
|
def _build_alphabet_by_rows_between(row_start: int, row_end: int) -> list[str]:
|
|
@@ -91,7 +91,7 @@ def query_category(c: str) -> str | None:
|
|
|
91
91
|
elif 0xA1 <= first_byte <= 0xDF:
|
|
92
92
|
return 'single-byte-half-width-katakana'
|
|
93
93
|
else:
|
|
94
|
-
|
|
94
|
+
return None
|
|
95
95
|
else:
|
|
96
96
|
second_byte = bs[1]
|
|
97
97
|
if 0x81 <= first_byte <= 0x87 or (first_byte == 0x88 and second_byte <= 0x9E):
|
|
@@ -99,7 +99,7 @@ def query_category(c: str) -> str | None:
|
|
|
99
99
|
elif (first_byte == 0x88 and second_byte >= 0x9F) or 0x89 <= first_byte <= 0x9F or 0xE0 <= first_byte <= 0xEF:
|
|
100
100
|
return 'double-byte-kanji'
|
|
101
101
|
else:
|
|
102
|
-
|
|
102
|
+
return None
|
|
103
103
|
|
|
104
104
|
|
|
105
105
|
def _build_alphabet_single_byte(byte_start: int, byte_end: int) -> list[str]:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|