Examples of ViterbiLattice


Examples of com.atilika.kuromoji.viterbi.ViterbiLattice

        this.viterbiSearcher = new ViterbiSearcher(this.viterbiBuilder, mode, dictionaries.getCosts(), dictionaries.getUnknownDictionary());
    this.formatter = new ViterbiFormatter(dictionaries.getCosts());
  }

  public String debugTokenize(String text) {
    ViterbiLattice lattice = this.viterbiBuilder.build(text);
    List<ViterbiNode> bestPath = this.viterbiSearcher.search(lattice);
    return this.formatter.format(lattice, bestPath);
  }
View Full Code Here

Examples of com.atilika.kuromoji.viterbi.ViterbiLattice

     * @return list of Token
     */
    private List<Token> doTokenize(int offset, String sentence) {
        ArrayList<Token> result = new ArrayList<Token>();

        ViterbiLattice lattice = viterbiBuilder.build(sentence);
        List<ViterbiNode> bestPath = viterbiSearcher.search(lattice);
        for (ViterbiNode node : bestPath) {
            int wordId = node.getWordId();
            if (node.getType() == ViterbiNode.Type.KNOWN && wordId == -1) { // Do not include BOS/EOS
                continue;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.