From a2e10e5a0507b7f81dad56db32c7359fcd427fee Mon Sep 17 00:00:00 2001 From: Mujeeb Cpy Date: Thu, 19 Sep 2024 16:06:31 +0200 Subject: [PATCH] fix normalizer and to ascii conversion --- libindic/payyans/core.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libindic/payyans/core.py b/libindic/payyans/core.py index 5f0a3be..a3fba0d 100755 --- a/libindic/payyans/core.py +++ b/libindic/payyans/core.py @@ -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) @@ -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') ''' കിട്ടിയ അക്ഷരങ്ങളുടെ അപ്പുറത്തും ഇപ്പുറത്തും സ്വരചിഹ്നങ്ങള്‍ ഫിറ്റ് ചെയ്യാനുള്ള ബദ്ധപ്പാട് @@ -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 # മതം മാറ്റി തിരിച്ചു കൊടുക്ക്വാ ! @@ -210,4 +209,4 @@ def get_info(self): def getInstance(): - return Payyans() \ No newline at end of file + return Payyans()