Skip to content
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.

Commit

Permalink
[apps] modify cleaning logic moved to engine
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephGeoBenjamin committed Sep 1, 2020
1 parent ab742d5 commit 8b17fd6
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions apps/api_expose.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def __init__(self):
self.langs = {"hi": "Hindi", "gom": "Konkani (Goan)", "mai": "Maithili"}

try:
from models.hindi.program85 import inference_engine as hindi_engine
from models.hindi.hi_program110 import inference_engine as hindi_engine
self.hindi_engine = hindi_engine
except Exception as error:
print("Failure in loading Hindi \n", error)
Expand All @@ -150,7 +150,6 @@ def __init__(self):
del self.langs['mai']

def transliterate(self, lang_code, eng_word):
eng_word = self._clean(eng_word)
if eng_word == "":
return []

Expand All @@ -170,11 +169,6 @@ def transliterate(self, lang_code, eng_word):
print("Error:", error)
return XlitError.unknown_err

def _clean(self, word):
word = word.lower()
accepted = "abcdefghijklmnopqrstuvwxyz1234567890."
word = ''.join([i for i in word if i in accepted])
return word

## -------------------------- Server Setup ---------------------------------- ##

Expand Down

0 comments on commit 8b17fd6

Please sign in to comment.