tamilstring 0.3.25__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.
- tamilstring-0.3.25/LICENCE +26 -0
- tamilstring-0.3.25/PKG-INFO +31 -0
- tamilstring-0.3.25/README.md +6 -0
- tamilstring-0.3.25/setup.cfg +4 -0
- tamilstring-0.3.25/setup.py +28 -0
- tamilstring-0.3.25/tamilstring/__init__.py +3 -0
- tamilstring-0.3.25/tamilstring/constant.py +18 -0
- tamilstring-0.3.25/tamilstring/func.py +227 -0
- tamilstring-0.3.25/tamilstring/helper.py +395 -0
- tamilstring-0.3.25/tamilstring/utf8.py +150 -0
- tamilstring-0.3.25/tamilstring.egg-info/PKG-INFO +31 -0
- tamilstring-0.3.25/tamilstring.egg-info/SOURCES.txt +17 -0
- tamilstring-0.3.25/tamilstring.egg-info/dependency_links.txt +1 -0
- tamilstring-0.3.25/tamilstring.egg-info/requires.txt +3 -0
- tamilstring-0.3.25/tamilstring.egg-info/top_level.txt +1 -0
- tamilstring-0.3.25/tests/test_func.py +224 -0
- tamilstring-0.3.25/tests/test_letter.py +102 -0
- tamilstring-0.3.25/tests/test_string.py +92 -0
- tamilstring-0.3.25/tests/test_utf8.py +51 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
### 4. Add a `LICENSE`
|
|
3
|
+
Choose a license for your project and add a `LICENSE` file. For example, if you choose the MIT License, your `LICENSE` file might look like this:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) [year] [fullname]
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: tamilstring
|
|
3
|
+
Version: 0.3.25
|
|
4
|
+
Summary: tamilstring helps to handle tamil unicode characters lot more easier
|
|
5
|
+
Home-page: https://gitlab.com/boopalan-dev/tamilstring
|
|
6
|
+
Author: boopalan
|
|
7
|
+
Author-email: contact.boopalan@gmail.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.6
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENCE
|
|
14
|
+
Provides-Extra: dev
|
|
15
|
+
Requires-Dist: pytest>=6.0; extra == "dev"
|
|
16
|
+
Dynamic: author
|
|
17
|
+
Dynamic: author-email
|
|
18
|
+
Dynamic: classifier
|
|
19
|
+
Dynamic: description
|
|
20
|
+
Dynamic: description-content-type
|
|
21
|
+
Dynamic: home-page
|
|
22
|
+
Dynamic: provides-extra
|
|
23
|
+
Dynamic: requires-python
|
|
24
|
+
Dynamic: summary
|
|
25
|
+
|
|
26
|
+
# TamilString
|
|
27
|
+
|
|
28
|
+
tamilstring helps to handle tamil unicode characters lot more easier.
|
|
29
|
+
|
|
30
|
+
raise you issiues here => https://gitlab.com/boopalan-dev/tamilstring
|
|
31
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
with open("README.md", "r", encoding="utf-8") as fh:
|
|
4
|
+
long_description = fh.read()
|
|
5
|
+
|
|
6
|
+
setup(
|
|
7
|
+
name="tamilstring",
|
|
8
|
+
version="0.3.25",
|
|
9
|
+
author="boopalan",
|
|
10
|
+
author_email="contact.boopalan@gmail.com",
|
|
11
|
+
description="tamilstring helps to handle tamil unicode characters lot more easier",
|
|
12
|
+
long_description=long_description,
|
|
13
|
+
long_description_content_type="text/markdown",
|
|
14
|
+
url="https://gitlab.com/boopalan-dev/tamilstring",
|
|
15
|
+
packages=find_packages(),
|
|
16
|
+
classifiers=[
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
],
|
|
21
|
+
python_requires=">=3.6",
|
|
22
|
+
install_requires=[],
|
|
23
|
+
extras_require={
|
|
24
|
+
"dev": [
|
|
25
|
+
"pytest>=6.0",
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
VOULES_LET = ["அ","ஆ","இ","ஈ","உ","ஊ","எ","ஏ","ஐ","ஒ","ஓ","ஔ"]
|
|
2
|
+
VOULES_SYM = ["ா", "ி", "ீ", "ு", "ூ", "ெ", "ே", "ை", "ொ", "ோ", "ௌ" ]
|
|
3
|
+
EXACT_VOULE = ["அ","ஆ","இ","ஈ","உ","ஊ","எ","ஏ","ஐ","ஒ","ஓ","ஔ"]
|
|
4
|
+
EXACT_CONSTANT =["க","ங","ச","ஞ","ட","ண","த","ந","ப","ம","ய","ர","ல","வ","ழ","ள","ற","ன"]
|
|
5
|
+
UTF_VOULE = ['்', "ா", "ி", "ீ", "ு", "ூ", "ெ", "ே", "ை", "ொ", "ோ", "ௌ" ]
|
|
6
|
+
AUTHAM = "ஃ"
|
|
7
|
+
sanskrit_letters = ["ஶ", "ஜ", "ஷ", "ஸ", "ஹ", "க்ஷ"]
|
|
8
|
+
sanskrit_mei_letters = ["ஶ்", "ஜ்", "ஷ்", "ஸ்", "ஹ்", "க்ஷ்"]
|
|
9
|
+
tamil_num = ["௦", "௧", "௨", "௩", "௪", "௫", "௬", "௭", "௮", "௯", "௰""௱","௲"]
|
|
10
|
+
tamil_sym=["௳","௴","௵","௶","௷","௹","௺"]
|
|
11
|
+
english_alp_sm = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
|
|
12
|
+
english_alp_cp = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
|
|
13
|
+
english_num = ["0","1","2","3","4","5","6","7","8","9"]
|
|
14
|
+
english_sym = [".",",","?",":",";"]
|
|
15
|
+
|
|
16
|
+
HARD_CONSTAND = ["க்","ச்","ட்","த்","ப்","ற்"]
|
|
17
|
+
SOFT_CONSTANT = ["ங்","ஞ்","ண்","ந்", "ம்","ன்"]
|
|
18
|
+
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
from .helper import String, Letter
|
|
2
|
+
from .constant import SOFT_CONSTANT,HARD_CONSTAND
|
|
3
|
+
|
|
4
|
+
letter_singleton_source = Letter(singleton = True)
|
|
5
|
+
letter_singleton_backup = letter_singleton_source.letter
|
|
6
|
+
|
|
7
|
+
string_singleton_source = String(singleton = True)
|
|
8
|
+
string_singleton_backup = string_singleton_source.string
|
|
9
|
+
|
|
10
|
+
def is_english(vowel):
|
|
11
|
+
take_letter_backup(vowel)
|
|
12
|
+
return_bool = True if letter_singleton_source.lang == "en" else False
|
|
13
|
+
restore_letter_backup()
|
|
14
|
+
return return_bool
|
|
15
|
+
|
|
16
|
+
def is_tamil(vowel):
|
|
17
|
+
take_letter_backup(vowel)
|
|
18
|
+
return_bool = True if letter_singleton_source.lang == "ta" else False
|
|
19
|
+
restore_letter_backup()
|
|
20
|
+
return return_bool
|
|
21
|
+
|
|
22
|
+
def is_sanskrit(vowel):
|
|
23
|
+
take_letter_backup(vowel)
|
|
24
|
+
return_bool = True if letter_singleton_source.lang == "sa" else False
|
|
25
|
+
restore_letter_backup()
|
|
26
|
+
return return_bool
|
|
27
|
+
|
|
28
|
+
def is_tamil_num(vowel):
|
|
29
|
+
take_letter_backup(vowel)
|
|
30
|
+
return_bool = True if letter_singleton_source.lang == "ta" and letter_singleton_source.kind == "NUM" else False
|
|
31
|
+
restore_letter_backup()
|
|
32
|
+
return return_bool
|
|
33
|
+
|
|
34
|
+
def is_english_num(vowel):
|
|
35
|
+
take_letter_backup(vowel)
|
|
36
|
+
return_bool = True if letter_singleton_source.lang == "en" and letter_singleton_source.kind == "NUM" else False
|
|
37
|
+
restore_letter_backup()
|
|
38
|
+
return return_bool
|
|
39
|
+
|
|
40
|
+
def is_tamil_char(vowel):
|
|
41
|
+
take_letter_backup(vowel)
|
|
42
|
+
return_bool = True if letter_singleton_source.kind == "CAR" else False
|
|
43
|
+
restore_letter_backup()
|
|
44
|
+
return return_bool
|
|
45
|
+
|
|
46
|
+
def is_vowel(vowel):
|
|
47
|
+
take_letter_backup(vowel)
|
|
48
|
+
return_bool = True if letter_singleton_source.is_voule else False
|
|
49
|
+
restore_letter_backup()
|
|
50
|
+
return return_bool
|
|
51
|
+
|
|
52
|
+
def is_constant(constant):
|
|
53
|
+
take_letter_backup(constant)
|
|
54
|
+
return_bool = True if letter_singleton_source.is_constant else False
|
|
55
|
+
restore_letter_backup()
|
|
56
|
+
return return_bool
|
|
57
|
+
|
|
58
|
+
def is_compound(compound):
|
|
59
|
+
take_letter_backup(compound)
|
|
60
|
+
return_bool = True if letter_singleton_source.is_compound else False
|
|
61
|
+
restore_letter_backup()
|
|
62
|
+
return return_bool
|
|
63
|
+
|
|
64
|
+
def is_aytham(aytham):
|
|
65
|
+
if aytham == "ஃ":
|
|
66
|
+
return True
|
|
67
|
+
else:
|
|
68
|
+
return False
|
|
69
|
+
|
|
70
|
+
def constant(letter):
|
|
71
|
+
take_letter_backup(letter)
|
|
72
|
+
return_constant = letter_singleton_source.constant
|
|
73
|
+
restore_letter_backup()
|
|
74
|
+
return return_constant
|
|
75
|
+
|
|
76
|
+
def vowel(letter):
|
|
77
|
+
take_letter_backup(letter)
|
|
78
|
+
return_constant = letter_singleton_source.voule
|
|
79
|
+
restore_letter_backup()
|
|
80
|
+
return return_constant
|
|
81
|
+
|
|
82
|
+
def hard_constant(letter):
|
|
83
|
+
take_letter_backup(letter)
|
|
84
|
+
constant_letter = letter_singleton_source.constant
|
|
85
|
+
return_constant = None
|
|
86
|
+
for related , constant in zip(HARD_CONSTAND,SOFT_CONSTANT):
|
|
87
|
+
if constant_letter == constant:
|
|
88
|
+
return_constant = related
|
|
89
|
+
break
|
|
90
|
+
restore_letter_backup()
|
|
91
|
+
return return_constant
|
|
92
|
+
|
|
93
|
+
def soft_constant(letter):
|
|
94
|
+
take_letter_backup(letter)
|
|
95
|
+
constant_letter = letter_singleton_source.constant
|
|
96
|
+
return_constant = None
|
|
97
|
+
for related , constant in zip(SOFT_CONSTANT,HARD_CONSTAND):
|
|
98
|
+
if constant_letter == constant:
|
|
99
|
+
return_constant = related
|
|
100
|
+
break
|
|
101
|
+
restore_letter_backup()
|
|
102
|
+
return return_constant
|
|
103
|
+
|
|
104
|
+
def get_constants(value,index=False):
|
|
105
|
+
take_string_backup(value)
|
|
106
|
+
return_list = []
|
|
107
|
+
for indces, letter in enumerate(string_singleton_source.capsules):
|
|
108
|
+
if letter[-1] == "CON":
|
|
109
|
+
return_list.append([indces,letter[1]])
|
|
110
|
+
restore_letter_backup()
|
|
111
|
+
if index:
|
|
112
|
+
return return_list
|
|
113
|
+
else:
|
|
114
|
+
return [ each[-1] for each in return_list ]
|
|
115
|
+
|
|
116
|
+
def get_vowels(value,index=False):
|
|
117
|
+
take_string_backup(value)
|
|
118
|
+
return_list = []
|
|
119
|
+
for indces, letter in enumerate(string_singleton_source.capsules):
|
|
120
|
+
if letter[-1] == "VOL":
|
|
121
|
+
return_list.append([indces,letter[1]])
|
|
122
|
+
restore_letter_backup()
|
|
123
|
+
if index:
|
|
124
|
+
return return_list
|
|
125
|
+
else:
|
|
126
|
+
return [ each[-1] for each in return_list ]
|
|
127
|
+
|
|
128
|
+
def get_compounds(value,index=False):
|
|
129
|
+
take_string_backup(value)
|
|
130
|
+
return_list = []
|
|
131
|
+
for indces, letter in enumerate(string_singleton_source.capsules):
|
|
132
|
+
if letter[-1] == "COM":
|
|
133
|
+
return_list.append([indces,letter[1]])
|
|
134
|
+
restore_letter_backup()
|
|
135
|
+
if index:
|
|
136
|
+
return return_list
|
|
137
|
+
else:
|
|
138
|
+
return [ each[-1] for each in return_list ]
|
|
139
|
+
|
|
140
|
+
def get_tamil(string,only=[]):
|
|
141
|
+
take_string_backup(string)
|
|
142
|
+
return_list = []
|
|
143
|
+
for letter in string_singleton_source.capsules:
|
|
144
|
+
if letter[0] == "ta":
|
|
145
|
+
if letter[-1] in only:
|
|
146
|
+
return_list.append(letter)
|
|
147
|
+
else:
|
|
148
|
+
return_list.append(letter)
|
|
149
|
+
restore_string_backup()
|
|
150
|
+
return capsule_letter(return_list)
|
|
151
|
+
|
|
152
|
+
def get_english(string,only=[]):
|
|
153
|
+
take_string_backup(string)
|
|
154
|
+
return_list = []
|
|
155
|
+
for letter in string_singleton_source.capsules:
|
|
156
|
+
if letter[0] == "en":
|
|
157
|
+
if letter[-1] in only:
|
|
158
|
+
return_list.append(letter)
|
|
159
|
+
else:
|
|
160
|
+
return_list.append(letter)
|
|
161
|
+
restore_string_backup()
|
|
162
|
+
return capsule_letter(return_list)
|
|
163
|
+
|
|
164
|
+
def get_sanskrit(string,only=[]):
|
|
165
|
+
take_string_backup(string)
|
|
166
|
+
return_list = []
|
|
167
|
+
for letter in string_singleton_source.capsules:
|
|
168
|
+
if letter[0] == "sa":
|
|
169
|
+
if letter[-1] in only:
|
|
170
|
+
return_list.append(letter)
|
|
171
|
+
else:
|
|
172
|
+
return_list.append(letter)
|
|
173
|
+
restore_string_backup()
|
|
174
|
+
return capsule_letter(return_list)
|
|
175
|
+
|
|
176
|
+
def get_tamil_numerals(string):
|
|
177
|
+
take_string_backup(string)
|
|
178
|
+
return_list = []
|
|
179
|
+
for letter in string_singleton_source.capsules:
|
|
180
|
+
if letter[0] == "ta":
|
|
181
|
+
if letter[-1] == "NUM":
|
|
182
|
+
return_list.append(letter)
|
|
183
|
+
restore_string_backup()
|
|
184
|
+
return capsule_letter(return_list)
|
|
185
|
+
|
|
186
|
+
def get_tamil_symbols(string):
|
|
187
|
+
take_string_backup(string)
|
|
188
|
+
return_list = []
|
|
189
|
+
for letter in string_singleton_source.capsules:
|
|
190
|
+
if letter[0] == "ta":
|
|
191
|
+
if letter[-1] == "CAR":
|
|
192
|
+
return_list.append(letter)
|
|
193
|
+
restore_string_backup()
|
|
194
|
+
return capsule_letter(return_list)
|
|
195
|
+
|
|
196
|
+
def capsule_letter(capsules):
|
|
197
|
+
if isinstance(capsules,tuple):
|
|
198
|
+
return capsules[1]
|
|
199
|
+
else:
|
|
200
|
+
return_letters = []
|
|
201
|
+
for letter in capsules:
|
|
202
|
+
return_letters.append(letter[1])
|
|
203
|
+
return return_letters
|
|
204
|
+
|
|
205
|
+
def take_letter_backup(value):
|
|
206
|
+
if isinstance(value, Letter):
|
|
207
|
+
letter_singleton_backup = value.letter
|
|
208
|
+
letter_singleton_source.letter = value
|
|
209
|
+
else:
|
|
210
|
+
if letter_singleton_source.letter != None:
|
|
211
|
+
letter_singleton_backup = letter_singleton_source.letter
|
|
212
|
+
letter_singleton_source.letter = value
|
|
213
|
+
|
|
214
|
+
def restore_letter_backup():
|
|
215
|
+
letter_singleton_source.letter =letter_singleton_backup
|
|
216
|
+
|
|
217
|
+
def take_string_backup(value):
|
|
218
|
+
if isinstance(value, String):
|
|
219
|
+
string_singleton_backup = value.string
|
|
220
|
+
string_singleton_source.string = value
|
|
221
|
+
else:
|
|
222
|
+
if string_singleton_source.string != None:
|
|
223
|
+
string_singleton_backup = string_singleton_source.string
|
|
224
|
+
string_singleton_source.string = value
|
|
225
|
+
|
|
226
|
+
def restore_string_backup():
|
|
227
|
+
string_singleton_source.string = string_singleton_backup
|