jntajis-python 0.0.17__cp313-cp313-win32.whl
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.
- jntajis/__init__.py +120 -0
- jntajis/_jntajis.cp313-win32.pyd +0 -0
- jntajis/_jntajis.h +704510 -0
- jntajis/_jntajis.pyi +17 -0
- jntajis/_jntajis.pyx +1114 -0
- jntajis/_version.py +34 -0
- jntajis/gen.py +843 -0
- jntajis/py.typed +0 -0
- jntajis/pythoncapi_compat_shim.h +20 -0
- jntajis/xlsx_parser/__init__.py +1 -0
- jntajis/xlsx_parser/parser.py +591 -0
- jntajis/xlsx_parser/xmlutils.py +332 -0
- jntajis_python-0.0.17.dist-info/METADATA +117 -0
- jntajis_python-0.0.17.dist-info/RECORD +16 -0
- jntajis_python-0.0.17.dist-info/WHEEL +4 -0
- jntajis_python-0.0.17.dist-info/licenses/LICENSE +29 -0
jntajis/__init__.py
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"""
|
|
2
|
+
A fast character conversion and transliteration library based on
|
|
3
|
+
the scheme defined for Japan National Tax Agency (国税庁) 's
|
|
4
|
+
corporate number (法人番号) system.
|
|
5
|
+
|
|
6
|
+
This library makes use of the data from the following entities:
|
|
7
|
+
|
|
8
|
+
* JIS shrink conversion map (国税庁: JIS縮退マップ)
|
|
9
|
+
|
|
10
|
+
Published by: National Tax Agency
|
|
11
|
+
Author: unknown
|
|
12
|
+
Source: https://www.houjin-bangou.nta.go.jp/download/
|
|
13
|
+
Copyright / license: public domain? (needs to be clarified.)
|
|
14
|
+
|
|
15
|
+
* MJ character table (文字情報技術促進協議会: MJ文字一覧表)
|
|
16
|
+
|
|
17
|
+
Published by: Character Information Technology Promotion
|
|
18
|
+
Council (CITPC)
|
|
19
|
+
Author: Information-technology Promotion Agency (IPA)
|
|
20
|
+
Source: https://moji.or.jp/mojikiban/mjlist/
|
|
21
|
+
Copyright / license: CC BY-SA 2.1 JP
|
|
22
|
+
|
|
23
|
+
* MJ shrink conversion map (文字情報技術促進協議会: MJ縮退マップ)
|
|
24
|
+
Published by: Character Information Technology Promotion
|
|
25
|
+
Council (CITPC)
|
|
26
|
+
Author: Information-technology Promotion Agency (IPA)
|
|
27
|
+
Source: https://moji.or.jp/mojikiban/map/
|
|
28
|
+
Copyright / license: CC BY-SA 2.1 JP
|
|
29
|
+
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
import enum
|
|
33
|
+
|
|
34
|
+
try:
|
|
35
|
+
from ._jntajis import (
|
|
36
|
+
IncrementalEncoder,
|
|
37
|
+
TransliterationError,
|
|
38
|
+
jnta_decode,
|
|
39
|
+
jnta_encode,
|
|
40
|
+
jnta_shrink_translit,
|
|
41
|
+
mj_shrink_candidates,
|
|
42
|
+
)
|
|
43
|
+
from ._version import __version__, __version_tuple__
|
|
44
|
+
except ImportError:
|
|
45
|
+
pass
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
__all__ = [
|
|
49
|
+
"__version__",
|
|
50
|
+
"__version_tuple__",
|
|
51
|
+
"IncrementalEncoder",
|
|
52
|
+
"TransliterationError",
|
|
53
|
+
"jnta_encode",
|
|
54
|
+
"jnta_decode",
|
|
55
|
+
"jnta_shrink_translit",
|
|
56
|
+
"mj_shrink_candidates",
|
|
57
|
+
"ConversionMode",
|
|
58
|
+
"MJShrinkScheme",
|
|
59
|
+
"MJShrinkSchemeCombo",
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class ConversionMode(enum.IntEnum):
|
|
64
|
+
SISO = 0
|
|
65
|
+
"""
|
|
66
|
+
Instructs the encoder to encode the given string into JIS X 0213 with the
|
|
67
|
+
ISO 2022 escape sequences SI (``\x0e``) and SO (``\x0f``) for the extended
|
|
68
|
+
plane selection.
|
|
69
|
+
"""
|
|
70
|
+
MEN1 = 1
|
|
71
|
+
"""
|
|
72
|
+
Instructs the encoder to encode the given string into JIS X 0213 characters
|
|
73
|
+
designated in the primary plane, which would theoretically contain JIS X
|
|
74
|
+
0208 level 1 and 2 characters. Characters belonging to the extended plane
|
|
75
|
+
will result in conversion failure.
|
|
76
|
+
"""
|
|
77
|
+
JISX0208 = 2
|
|
78
|
+
"""
|
|
79
|
+
Instructs it to encode the given string into JIS X 0208 level 1 and 2
|
|
80
|
+
characters. Non-0208 characters will result in conversion failure.
|
|
81
|
+
"""
|
|
82
|
+
JISX0208_TRANSLIT = 3
|
|
83
|
+
"""
|
|
84
|
+
Instructs it to encode the given string into JIS X 0208 level 1 and 2
|
|
85
|
+
characters. Non-0208 characters will be tried the transliteration against.
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class MJShrinkScheme(enum.IntEnum):
|
|
90
|
+
JIS_INCORPORATION_UCS_UNIFICATION_RULE = 0
|
|
91
|
+
INFERENCE_BY_READING_AND_GLYPH = 1
|
|
92
|
+
MOJ_NOTICE_582 = 2
|
|
93
|
+
MOJ_FAMILY_REGISTER_ACT_RELATED_NOTICE = 3
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class MJShrinkSchemeCombo(enum.IntFlag):
|
|
97
|
+
JIS_INCORPORATION_UCS_UNIFICATION_RULE = 1
|
|
98
|
+
"""
|
|
99
|
+
Instructs it to transliterate the given characters according to JIS
|
|
100
|
+
incorporation and UCS unification rule (a.k.a. JIS包摂規準・UCS統合規則)
|
|
101
|
+
if applicable.
|
|
102
|
+
"""
|
|
103
|
+
INFERENCE_BY_READING_AND_GLYPH = 2
|
|
104
|
+
"""
|
|
105
|
+
Instructs it to transliterate the given characters according to the
|
|
106
|
+
CITPC-defined rule based on analogy from readings and glyphs of characters
|
|
107
|
+
(読み・字形による類推.)
|
|
108
|
+
"""
|
|
109
|
+
MOJ_NOTICE_582 = 4
|
|
110
|
+
"""
|
|
111
|
+
Instructs it to transliterate the given characters according to the
|
|
112
|
+
appendix table proposed in Japan Ministry of Justice (MOJ) notice no. 582
|
|
113
|
+
(法務省告示582号別表第四.)
|
|
114
|
+
"""
|
|
115
|
+
MOJ_FAMILY_REGISTER_ACT_RELATED_NOTICE = 8
|
|
116
|
+
"""
|
|
117
|
+
Instructs it to transliterate the given characters according to the
|
|
118
|
+
Family Register Act (戸籍法) and related MOJ notices
|
|
119
|
+
(法務省戸籍法関連通達・通知.)
|
|
120
|
+
"""
|
|
Binary file
|