rahulrana0001 commited on
Commit
999b0ce
·
1 Parent(s): 923f88e

Support modern Tamil translations with comprehensive case suffixes, pronouns, and verb endings

Browse files
Files changed (1) hide show
  1. pipeline/translation.py +32 -9
pipeline/translation.py CHANGED
@@ -163,8 +163,9 @@ class Translator:
163
  "எங்கே": "எங்க",
164
  "மிகவும்": "ரொம்ப",
165
  "மகிழ்ச்சி": "சந்தோஷம்",
166
- "பெரிய": "பெருசு",
167
- "சிறிய": "சின்னது",
 
168
  "வருகிறேன்": "வர்றேன்",
169
  "போகிறேன்": "போறேன்",
170
  "இருக்கிறேன்": "இருக்கேன்",
@@ -183,6 +184,10 @@ class Translator:
183
  "தந்தை": "அப்பா",
184
  "sகோதரர்": "அண்ணன்",
185
  "sகோதரி": "அக்கா",
 
 
 
 
186
  # English Loanwords (Tanglish - Common people way)
187
  "உணவகம்": "Hotel",
188
  "பேருந்து": "Bus",
@@ -272,13 +277,31 @@ class Translator:
272
  text = re.sub(r'ஒன்பது மணி', '9 மணி', text)
273
  text = re.sub(r'பத்து மணி', '10 மணி', text)
274
 
275
- text = re.sub(r'கிறேன்\b', 'றேன்', text)
276
- text = re.sub(r'கிறாய்\b', 'ற', text)
277
- text = re.sub(r'கிறான்\b', 'றான்', text)
278
- text = re.sub(r'கிறாள்\b', 'றா', text)
279
- text = re.sub(r'கிறார்\b', 'றார்', text)
280
- text = re.sub(r'கிறார்கள்\b', 'றாங்க', text)
281
- text = re.sub(r'கிறது\b', 'து', text)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
282
 
283
  return text
284
 
 
163
  "எங்கே": "எங்க",
164
  "மிகவும்": "ரொம்ப",
165
  "மகிழ்ச்சி": "சந்தோஷம்",
166
+ "பெரியது": "பெருசு",
167
+ "சிறிய": "சின்ன",
168
+ "சிறியது": "சின்னது",
169
  "வருகிறேன்": "வர்றேன்",
170
  "போகிறேன்": "போறேன்",
171
  "இருக்கிறேன்": "இருக்கேன்",
 
184
  "தந்தை": "அப்பா",
185
  "sகோதரர்": "அண்ணன்",
186
  "sகோதரி": "அக்கா",
187
+ "அவர்கள்": "அவங்க",
188
+ "இவர்கள்": "இவங்க",
189
+ "அவள்": "அவ",
190
+ "இவள்": "இவ",
191
  # English Loanwords (Tanglish - Common people way)
192
  "உணவகம்": "Hotel",
193
  "பேருந்து": "Bus",
 
277
  text = re.sub(r'ஒன்பது மணி', '9 மணி', text)
278
  text = re.sub(r'பத்து மணி', '10 மணி', text)
279
 
280
+ # Verb Tense & Agreement Endings
281
+ text = re.sub(r'கிறேன்(?=[^\u0b80-\u0bff]|$)', 'றேன்', text)
282
+ text = re.sub(r'கிறாய்(?=[^\u0b80-\u0bff]|$)', 'ற', text)
283
+ text = re.sub(r'கிறான்(?=[^\u0b80-\u0bff]|$)', 'றான்', text)
284
+ text = re.sub(r'கிறாள்(?=[^\u0b80-\u0bff]|$)', 'றா', text)
285
+ text = re.sub(r'கிறார்(?=[^\u0b80-\u0bff]|$)', 'றார்', text)
286
+ text = re.sub(r'கிறார்கள்(?=[^\u0b80-\u0bff]|$)', 'றாங்க', text)
287
+ text = re.sub(r'க்கிறது(?=[^\u0b80-\u0bff]|$)', 'து', text)
288
+ text = re.sub(r'கிறது(?=[^\u0b80-\u0bff]|$)', 'து', text)
289
+ text = re.sub(r'கின்றது(?=[^\u0b80-\u0bff]|$)', 'து', text)
290
+ text = re.sub(r'விட்டது(?=[^\u0b80-\u0bff]|$)', 'டுச்சு', text)
291
+
292
+ # Modern Case Suffixes & Spoken Conversational Grammar
293
+ text = re.sub(r'உடைய(?=[^\u0b80-\u0bff]|$)', 'ோட', text)
294
+ text = re.sub(r'இல்(?=[^\u0b80-\u0bff]|$)', 'ல', text)
295
+ text = re.sub(r'ஆல்(?=[^\u0b80-\u0bff]|$)', 'ால', text)
296
+ text = re.sub(r'திற்கு(?=[^\u0b80-\u0bff]|$)', 'துக்கு', text)
297
+ text = re.sub(r'இற்கு(?=[^\u0b80-\u0bff]|$)', 'ுக்கு', text)
298
+ text = re.sub(r'வில்லை(?=[^\u0b80-\u0bff]|$)', 'ல', text)
299
+ text = re.sub(r'ார்(?=[^\u0b80-\u0bff]|$)', 'ாரு', text)
300
+ text = re.sub(r'தனர்(?=[^\u0b80-\u0bff]|$)', 'தாங்க', text)
301
+ text = re.sub(r'இனர்(?=[^\u0b80-\u0bff]|$)', 'ினாங்க', text)
302
+ text = re.sub(r'தார்கள்(?=[^\u0b80-\u0bff]|$)', 'தாங்க', text)
303
+ text = re.sub(r'னார்கள்(?=[^\u0b80-\u0bff]|$)', 'னாங்க', text)
304
+ text = re.sub(r'கொண்டனர்(?=[^\u0b80-\u0bff]|$)', 'கிட்டாங்க', text)
305
 
306
  return text
307