Example #1
0
    def __init__(self, db):
        self.dict_handler = DictionaryDBHandler(db)

        rules = open("data/Rule.json", "r")
        rules = rules.read()
        self.tense_structures = json.loads(rules)

        suffices = open("data/suffices.json", "r")
        self.suffices = json.loads(suffices.read())

        self.utility = Utility()
Example #2
0
def test_dict():
    try:
        dicthandler = DictionaryDBHandler("data/dictionary.db")
        print("enter == to exit.. ")
        i = input("enter nepali unigram and meaning separated by comma: ")
        while i != '==':
            splitted = i.split(',')
            dicthandler.insert_unigram(splitted[0],
                                       tuple(splitted[1:len(splitted)]))
            i = input("enter nepali unigram and meaning separated by spaces: ")

        #print(dicthandler.get_english1('राम्रो'))
    except Exception as e:
        print(e)