Package com.atilika.kuromoji.trie

Examples of com.atilika.kuromoji.trie.DoubleArrayTrie


public class DoubleArrayTrieBuilder {

  public static DoubleArrayTrie build(Set<Entry<Integer, String>> entries, boolean compactTries) {
    Trie tempTrie = buildTrie(entries);
    DoubleArrayTrie daTrie = new DoubleArrayTrie(compactTries);
    daTrie.build(tempTrie);
    return daTrie;
  }
View Full Code Here


        System.out.println("building tokeninfo dict...");
        TokenInfoDictionaryBuilder tokenInfoBuilder = new TokenInfoDictionaryBuilder(format, encoding, normalizeEntries, addUnnormalizedEntries, dictionaryFilter);
        TokenInfoDictionary tokenInfoDictionary = tokenInfoBuilder.build(inputDirname);

        System.out.print("  building double array trie...");
        DoubleArrayTrie trie = DoubleArrayTrieBuilder.build(tokenInfoBuilder.entrySet(), compactTrie);
        trie.write(outputDirname);
        System.out.println("  done");

        System.out.print("  processing target map...");
        for (Entry<Integer, String> entry : tokenInfoBuilder.entrySet()) {
            int tokenInfoId = entry.getKey();
            String surfaceForm = entry.getValue();
            int doubleArrayId = trie.lookup(surfaceForm);
            assert doubleArrayId > 0;
            tokenInfoDictionary.addMapping(doubleArrayId, tokenInfoId);
        }
        tokenInfoDictionary.write(outputDirname);
View Full Code Here

TOP

Related Classes of com.atilika.kuromoji.trie.DoubleArrayTrie

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.