Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self,
alphabet,
lexicon,
insert_cost=DEFAULT_INSERT_COST,
delete_cost=DEFAULT_DELETE_COST,
substitute_cost=DEFAULT_SUBSTITUTE_COST):
super(LevenshteinAutomaton, self).__init__(alphabet, insert_cost,
delete_cost, substitute_cost)
# Compiles lexicon and composes the right factor with it.
compiled_lexicon = string_map(lexicon)
self._l_o = self._e_o @ compiled_lexicon
self._l_o.optimize(True)