Skip to content

Commit

Permalink
Merge pull request #41 from wrznr/fix_symbols
Browse files Browse the repository at this point in the history
Fix usage of symbol table for lookup
  • Loading branch information
wrznr authored Dec 17, 2021
2 parents ad4337f + 333cce2 commit 58cb93c
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions timur/fsts/timur_fst.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ def lookup(self, string):
'''
Analyse a string
'''
result = []
if self.__verify():
string_accep = pynini.accep(" ".join(c for c in string), token_type=self.__syms.alphabet)
intermediate = pynini.compose(self.__timur, string_accep)
paths = intermediate.paths(input_token_type=intermediate.input_symbols(),output_token_type=intermediate.output_symbols())
result = list(paths.items())
return result
with pynini.default_token_type(self.__syms.alphabet):
result = []
if self.__verify():
string_accep = pynini.accep(" ".join(c for c in string))
intermediate = pynini.compose(self.__timur, string_accep)
paths = intermediate.paths()
result = list(paths.items())
return result

def load(self, fst):
'''
Expand Down

0 comments on commit 58cb93c

Please sign in to comment.