コード例 #1
0
ファイル: vocab.py プロジェクト: studio-ousia/ntee
    def load(in_file, mmap=True):
        word_dict = Trie()
        entity_dict = Trie()

        word_dict.mmap(in_file + '_word.trie')
        entity_dict.mmap(in_file + '_entity.trie')

        return Vocab(word_dict, entity_dict)
コード例 #2
0
    def load(in_file, mmap=True):
        word_dict = Trie()
        entity_dict = Trie()

        word_dict.mmap(in_file + '_word.trie')
        entity_dict.mmap(in_file + '_entity.trie')

        return Vocab(word_dict, entity_dict)
コード例 #3
0
    def load(in_file, mmap=True):
        title_dict = Trie()
        redirect_dict = RecordTrie('<I')

        title_dict.mmap(in_file + '_title.trie')
        redirect_dict.mmap(in_file + '_redirect.trie')
        inlink_arr = np.load(in_file + '_prior.npy', mmap_mode='r')

        return EntityDB(title_dict, redirect_dict, inlink_arr)
コード例 #4
0
ファイル: entity_db.py プロジェクト: studio-ousia/ntee
    def load(in_file, mmap=True):
        title_dict = Trie()
        redirect_dict = RecordTrie('<I')

        title_dict.mmap(in_file + '_title.trie')
        redirect_dict.mmap(in_file + '_redirect.trie')
        inlink_arr = np.load(in_file + '_prior.npy', mmap_mode='r')

        return EntityDB(title_dict, redirect_dict, inlink_arr)