Skip to content

Commit

Permalink
Merge pull request #22 from mujeebcpy/fix-normalizer-ascii
Browse files Browse the repository at this point in the history
fix normalizer and to ascii conversion
  • Loading branch information
asdofindia committed Sep 19, 2024
2 parents ab8aeff + a2e10e5 commit 0acbb55
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions libindic/payyans/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(self):
self.rulesDict = None
self.pdf = 0
self.data = {"fonts": maps.keys()}
self.normalizer = Normalizer()
self.normalizer = Normalizer("ml")

def Unicode2ASCII(self, unicode_text, font):
unicode_text = self.normalizer.normalize(unicode_text)
Expand All @@ -71,7 +71,6 @@ def Unicode2ASCII(self, unicode_text, font):
letter = unicode_text[index:index + charNo]
if letter in self.rulesDict:
ascii_letter = self.rulesDict[letter]
letter = letter.encode('utf-8')
'''
കിട്ടിയ അക്ഷരങ്ങളുടെ അപ്പുറത്തും ഇപ്പുറത്തും
സ്വരചിഹ്നങ്ങള്‍ ഫിറ്റ് ചെയ്യാനുള്ള ബദ്ധപ്പാട്
Expand Down Expand Up @@ -131,7 +130,7 @@ def ASCII2Unicode(self, ascii_text, font):
unicode_text = transposed_text.translate(translator)

# മൂന്നാമത്തെ ഓട്ടം: ചേരുംപടി ചേര്‍ക്കുക
unicode_text = self.normalizer.normalize(unicode_text, keep_punctuations=True)
unicode_text = self.normalizer.normalize(unicode_text)

return unicode_text # മതം മാറ്റി തിരിച്ചു കൊടുക്ക്വാ !

Expand Down Expand Up @@ -210,4 +209,4 @@ def get_info(self):


def getInstance():
return Payyans()
return Payyans()

0 comments on commit 0acbb55

Please sign in to comment.