Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __next__(self):
r = self.iterator.next()
r[0] = LexiconSet.build_word_id(self.dict_id, r[0])
return r
def _read_system_dictionary(self, filename):
if filename is None:
raise AttributeError("system dictionary is not specified")
dict_ = BinaryDictionary.from_system_dictionary(filename)
self.dictionaries.append(dict_)
self.grammar = dict_.grammar
self.lexicon = LexiconSet(dict_.lexicon)
def __iter__(self, text, offset):
self.text = text
self.offset = offset
self.dict_id = 1
self.iterator = LexiconSet.lexicons[self.dict_id].lookup(text, offset)
return self