-
-
Notifications
You must be signed in to change notification settings - Fork 293
Expand file tree
/
Copy path__init__.py
More file actions
156 lines (152 loc) · 4.07 KB
/
__init__.py
File metadata and controls
156 lines (152 loc) · 4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# SPDX-FileCopyrightText: 2016-2026 PyThaiNLP Project
# SPDX-FileType: SOURCE
# SPDX-License-Identifier: Apache-2.0
"""Utility functions, like date conversion and digit conversion"""
__all__ = [
"Trie",
"abbreviation_to_full_text",
"arabic_digit_to_thai_digit",
"bahttext",
"censor_profanity",
"collate",
"contains_profanity",
"convert_years",
"count_thai_chars",
"countthai",
"dict_trie",
"digit_to_text",
"display_thai_char",
"emoji_to_thai",
"eng_to_thai",
"expand_maiyamok",
"find_keyword",
"find_profanity",
"ipa_to_rtgs",
"is_native_thai",
"isthai",
"isthaichar",
"longest_common_subsequence",
"nectec_to_ipa",
"normalize",
"now_reign_year",
"num_to_thaiword",
"maiyamok",
"rank",
"reign_year_to_ad",
"remove_dangling",
"remove_dup_spaces",
"remove_repeat_vowels",
"remove_spaces_before_marks",
"remove_tone_ipa",
"remove_tonemark",
"remove_trailing_repeat_consonants",
"remove_zw",
"reorder_vowels",
"rhyme",
"sound_syllable",
"spelling",
"spell_words",
"syllable_length",
"syllable_open_close_detector",
"text_to_arabic_digit",
"text_to_num",
"text_to_thai_digit",
"th_zodiac",
"thai_consonant_to_spelling",
"thai_digit_to_arabic_digit",
"thai_keyboard_dist",
"thai_strptime",
"thai_strftime",
"thai_to_eng",
"thai_word_tone_detector",
"thaiword_to_date",
"thaiword_to_num",
"thaiword_to_time",
"time_to_thaiword",
"tis620_to_utf8",
"to_idna",
"to_lunar_date",
"tone_detector",
"tone_to_spelling",
"words_to_num",
"analyze_thai_text",
]
from pythainlp.util import spell_words # noqa: I001 - keep block order to avoid circular imports
from pythainlp.util.abbreviation import abbreviation_to_full_text
from pythainlp.util.collate import collate
from pythainlp.util.date import (
convert_years,
now_reign_year,
reign_year_to_ad,
thai_strptime,
thaiword_to_date,
)
from pythainlp.util.digitconv import (
arabic_digit_to_thai_digit,
digit_to_text,
text_to_arabic_digit,
text_to_thai_digit,
thai_digit_to_arabic_digit,
)
from pythainlp.util.emojiconv import emoji_to_thai
from pythainlp.util.encoding import tis620_to_utf8, to_idna
from pythainlp.util.keyboard import (
eng_to_thai,
thai_keyboard_dist,
thai_to_eng,
)
from pythainlp.util.keywords import find_keyword, rank
from pythainlp.util.lcs import longest_common_subsequence
from pythainlp.util.normalize import (
expand_maiyamok,
maiyamok,
normalize,
remove_dangling,
remove_dup_spaces,
remove_repeat_vowels,
remove_spaces_before_marks,
remove_tonemark,
remove_zw,
reorder_vowels,
)
from pythainlp.util.numtoword import bahttext, num_to_thaiword
from pythainlp.util.phoneme import ipa_to_rtgs, nectec_to_ipa, remove_tone_ipa
from pythainlp.util.profanity import (
censor_profanity,
contains_profanity,
find_profanity,
)
from pythainlp.util.remove_trailing_repeat_consonants import (
remove_trailing_repeat_consonants,
)
from pythainlp.util.strftime import thai_strftime
from pythainlp.util.thai import (
analyze_thai_text,
count_thai_chars,
countthai,
display_thai_char,
isthai,
isthaichar,
thai_word_tone_detector,
)
from pythainlp.util.thai_lunar_date import th_zodiac, to_lunar_date
from pythainlp.util.thaiwordcheck import is_native_thai
from pythainlp.util.time import thaiword_to_time, time_to_thaiword
from pythainlp.util.trie import Trie, dict_trie
from pythainlp.util.wordtonum import text_to_num, thaiword_to_num, words_to_num
# DO NOT REORDER these imports.
# sound_syllable and pronounce have to be imported last,
# to prevent circular import issues.
# Other imports should be above this line, sorted.
from pythainlp.util.syllable import ( # noqa: I001
sound_syllable,
syllable_length,
syllable_open_close_detector,
tone_detector,
)
from pythainlp.util.pronounce import ( # noqa: I001
rhyme,
spelling,
thai_consonant_to_spelling,
tone_to_spelling,
)