@@ -37,23 +37,23 @@ def phoneme_scan(word):
3737 # while re.search("[a-zA-Z.,;!?]", word):
3838 while re .search ("[अ-ॐ.,;!?]" , word ):
3939
40- word = replace_with_phoneme (word , r'iew' , (phonemes .CONS_Y , phonemes .VOWEL_OO ,phonemes .CONS_W ))
40+ # word = replace_with_phoneme(word, r'iew', (phonemes.CONS_Y, phonemes.VOWEL_OO,phonemes.CONS_W))
4141
42- word = replace_with_phoneme (word , r'oo' , (phonemes .VOWEL_OO ,))
43- word = replace_with_phoneme (word , r'ou' , (phonemes .VOWEL_OO ,))
44- word = replace_with_phoneme (word , r'ea' , (phonemes .VOWEL_II ,))
45- word = replace_with_phoneme (word , r'ee' , (phonemes .VOWEL_II ,))
46-
47- word = replace_with_phoneme (word , r'gg' , (phonemes .CONS_J ,))
48- word = replace_with_phoneme (word , r'dd' , (phonemes .CONS_D ,))
49- word = replace_with_phoneme (word , r'ph' , (phonemes .CONS_F ,))
50- word = replace_with_phoneme (word , r'll' , (phonemes .CONS_L ,))
51- word = replace_with_phoneme (word , r'ss' , (phonemes .CONS_S ,))
52- word = replace_with_phoneme (word , r'nn' , (phonemes .CONS_N ,))
53- word = replace_with_phoneme (word , r'ch' , (phonemes .CONS_CH ,))
54- word = replace_with_phoneme (word , r'sh' , (phonemes .CONS_SH ,))
55- word = replace_with_phoneme (word , r'th' , (phonemes .CONS_TH ,))
56- word = replace_with_phoneme (word , r'ck' , (phonemes .CONS_K ,))
42+ # word = replace_with_phoneme(word, r'oo', (phonemes.VOWEL_OO,))
43+ # word = replace_with_phoneme(word, r'ou', (phonemes.VOWEL_OO,))
44+ # word = replace_with_phoneme(word, r'ea', (phonemes.VOWEL_II,))
45+ # word = replace_with_phoneme(word, r'ee', (phonemes.VOWEL_II,))
46+
47+ # word = replace_with_phoneme(word, r'gg', (phonemes.CONS_J,))
48+ # word = replace_with_phoneme(word, r'dd', (phonemes.CONS_D,))
49+ # word = replace_with_phoneme(word, r'ph', (phonemes.CONS_F,))
50+ # word = replace_with_phoneme(word, r'll', (phonemes.CONS_L,))
51+ # word = replace_with_phoneme(word, r'ss', (phonemes.CONS_S,))
52+ # word = replace_with_phoneme(word, r'nn', (phonemes.CONS_N,))
53+ # word = replace_with_phoneme(word, r'ch', (phonemes.CONS_CH,))
54+ # word = replace_with_phoneme(word, r'sh', (phonemes.CONS_SH,))
55+ # word = replace_with_phoneme(word, r'th', (phonemes.CONS_TH,))
56+ # word = replace_with_phoneme(word, r'ck', (phonemes.CONS_K,))
5757
5858# # Default letters
5959# क
@@ -94,9 +94,34 @@ def phoneme_scan(word):
9494# स
9595# ह
9696
97+ word = replace_with_phoneme (word , "अ" , (phonemes .VOWEL_U ,))
9798 word = replace_with_phoneme (word , "आ" , (phonemes .VOWEL_A ,))
9899 word = replace_with_phoneme (word , "ा" , (phonemes .VOWEL_A ,))
99100
101+ word = replace_with_phoneme (word , "इ" , (phonemes .VOWEL_I ,))
102+ word = replace_with_phoneme (word , "ि" , (phonemes .VOWEL_I ,))
103+ word = replace_with_phoneme (word , "ई" , (phonemes .VOWEL_II ,))
104+ word = replace_with_phoneme (word , "ी" , (phonemes .VOWEL_II ,))
105+
106+ word = replace_with_phoneme (word , "उ" , (phonemes .VOWEL_PU ,))
107+ word = replace_with_phoneme (word , "ु" , (phonemes .VOWEL_PU ,))
108+ word = replace_with_phoneme (word , "ऊ" , (phonemes .VOWEL_OO ,))
109+ word = replace_with_phoneme (word , "ू" , (phonemes .VOWEL_OO ,))
110+ word = replace_with_phoneme (word , "ृ" , (phonemes .CONS_R ,))
111+
112+ word = replace_with_phoneme (word , "ए" , (phonemes .VOWEL_AE ,))
113+ word = replace_with_phoneme (word , "े" , (phonemes .VOWEL_AE ,))
114+ word = replace_with_phoneme (word , "ॆ" , (phonemes .VOWEL_AE ,))
115+ word = replace_with_phoneme (word , "ऐ" , (phonemes .VOWEL_E ,))
116+ word = replace_with_phoneme (word , "ै" , (phonemes .VOWEL_E ,))
117+
118+ word = replace_with_phoneme (word , "ओ" , (phonemes .VOWEL_OH ,))
119+ word = replace_with_phoneme (word , "ऒ" , (phonemes .VOWEL_OH ,))
120+ word = replace_with_phoneme (word , "ो" , (phonemes .VOWEL_OH ,))
121+ word = replace_with_phoneme (word , "औ" , (phonemes .VOWEL_CA ,))
122+ word = replace_with_phoneme (word , "ौ" , (phonemes .VOWEL_CA ,))
123+ word = replace_with_phoneme (word , "ऑ" , (phonemes .VOWEL_CA ,))
124+
100125 word = replace_with_phoneme (word , "क" , (phonemes .CONS_K ,))
101126 word = replace_with_phoneme (word , "ख" , (phonemes .CONS_K ,))
102127 word = replace_with_phoneme (word , "ग" , (phonemes .CONS_G ,))
@@ -107,45 +132,43 @@ def phoneme_scan(word):
107132 word = replace_with_phoneme (word , "छ" , (phonemes .CONS_JJ ,))
108133 word = replace_with_phoneme (word , "ज" , (phonemes .CONS_J ,))
109134 word = replace_with_phoneme (word , "झ" , (phonemes .CONS_JJ ,))
135+ word = replace_with_phoneme (word , "ञ" , (phonemes .CONS_N ,))
110136
111137
112138 word = replace_with_phoneme (word , "ट" , (phonemes .CONS_T ,))
113139 word = replace_with_phoneme (word , "ठ" , (phonemes .CONS_TH ,))
114- word = replace_with_phoneme (word , "द" , (phonemes .CONS_TH2 ,))
115- word = replace_with_phoneme (word , "ध" , (phonemes .CONS_TH ,))
116-
117-
118140 word = replace_with_phoneme (word , "ड" , (phonemes .CONS_D ,))
119141 word = replace_with_phoneme (word , "ढ" , (phonemes .CONS_D ,))
120- word = replace_with_phoneme (word , "ब " , (phonemes .CONS_B ,))
142+ word = replace_with_phoneme (word , "ण " , (phonemes .CONS_N ,))
121143
122- word = replace_with_phoneme (word , "ऐ" , (phonemes .VOWEL_E ,))
123- word = replace_with_phoneme (word , "ै" , (phonemes .VOWEL_E ,))
144+ word = replace_with_phoneme (word , "त" , (phonemes .CONS_TH ,))
145+ word = replace_with_phoneme (word , "थ" , (phonemes .CONS_TH ,))
146+ word = replace_with_phoneme (word , "ध" , (phonemes .CONS_TH ,))
147+ word = replace_with_phoneme (word , "द" , (phonemes .CONS_TH2 ,))
148+ word = replace_with_phoneme (word , "न" , (phonemes .CONS_N ,))
124149
150+ word = replace_with_phoneme (word , "प" , (phonemes .CONS_P ,))
125151 word = replace_with_phoneme (word , "फ" , (phonemes .CONS_F ,))
126- word = replace_with_phoneme (word , "ह" , (phonemes .CONS_H ,))
127- word = replace_with_phoneme (word , "इ" , (phonemes .VOWEL_I ,))
128- word = replace_with_phoneme (word , "ि" , (phonemes .VOWEL_I ,))
152+ word = replace_with_phoneme (word , "ब" , (phonemes .CONS_B ,))
153+ word = replace_with_phoneme (word , "भ" , (phonemes .CONS_P ,))
154+ word = replace_with_phoneme (word , "म" , (phonemes .CONS_M ,))
155+ word = replace_with_phoneme (word , "य" , (phonemes .CONS_Y ,))
129156
157+ word = replace_with_phoneme (word , "र" , (phonemes .CONS_R ,))
130158 word = replace_with_phoneme (word , "ल" , (phonemes .CONS_L ,))
131- word = replace_with_phoneme (word , "म" , (phonemes .CONS_M ,))
132- word = replace_with_phoneme (word , "न" , (phonemes .CONS_N ,))
133- word = replace_with_phoneme (word , "ञ" , (phonemes .CONS_N ,))
134- word = replace_with_phoneme (word , "ण" , (phonemes .CONS_N ,))
159+ word = replace_with_phoneme (word , "व" , (phonemes .CONS_V ,))
160+ word = replace_with_phoneme (word , "श" , (phonemes .CONS_SH ,))
161+ word = replace_with_phoneme (word , "ष" , (phonemes .CONS_SH ,))
162+ word = replace_with_phoneme (word , "स" , (phonemes .CONS_S ,))
163+ word = replace_with_phoneme (word , "ह" , (phonemes .CONS_H ,))
164+
165+ word = replace_with_phoneme (word , "ज़" , (phonemes .CONS_Z ,))
166+
135167
136- word = replace_with_phoneme (word , "ो" , (phonemes .VOWEL_OH ,))
137- word = replace_with_phoneme (word , "प" , (phonemes .CONS_P ,))
138- word = replace_with_phoneme (word , "भ" , (phonemes .CONS_P ,))
139168 # word = replace_with_phoneme(word, "q", (phonemes.CONS_K,))
140- word = replace_with_phoneme (word , "र" , (phonemes .CONS_R ,))
141169
142- word = replace_with_phoneme (word , "स" , (phonemes .CONS_S ,))
143- word = replace_with_phoneme (word , "अ" , (phonemes .VOWEL_U ,))
144- word = replace_with_phoneme (word , "व" , (phonemes .CONS_V ,))
145170 # word = replace_with_phoneme(word, "w", (phonemes.CONS_W,))
146171 # word = replace_with_phoneme(word, "x", (phonemes.CONS_K, phonemes.CONS_S))
147- word = replace_with_phoneme (word , "य" , (phonemes .CONS_Y ,))
148- word = replace_with_phoneme (word , "ज़" , (phonemes .CONS_Z ,))
149172 word = replace_with_phoneme (word , "." , (phonemes .PUNC_PERIOD ,))
150173 word = replace_with_phoneme (word , "," , (phonemes .PUNC_COMMA ,))
151174 word = replace_with_phoneme (word , ";" , (phonemes .PUNC_COMMA ,))
0 commit comments