How to use the sudachipy.dictionarylib.lexiconset.LexiconSet function in SudachiPy

To help you get started, we’ve selected a few SudachiPy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github megagonlabs / ginza / sudachipy / dictionarylib / lexiconset.py View on Github external
def __next__(self):
            r = self.iterator.next()
            r[0] = LexiconSet.build_word_id(self.dict_id, r[0])
            return r
github WorksApplications / SudachiPy / sudachipy / dictionary.py View on Github external
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)
github megagonlabs / ginza / sudachipy / dictionarylib / lexiconset.py View on Github external
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