这三个类内容都比较少!眼干眼涩,想买眼药水了!WQNMD,居然某一天,我也需要使用眼药水了!!我的心脏都不跳了!!
package com.huaban.analysis.jieba;
public class Node {
public Character value;
public Node parent;
public Node(Character value, Node parent) {
this.value = value;
this.parent = parent;
}
}
上面的是Node类!单独看,看不出来啥!应该是写了个数据结构!一个字符值,一个父节点值!
package com.huaban.analysis.jieba;
public class Pair<K> {
public K key;
public Double freq = 0.0;
public Pair(K key, double freq) {
this.key = key;
this.freq = freq;
}
@Override
public String toString() {
return "Candidate [key=" + key + ", freq=" + freq + "]";
}
}
这个是Pair类,键值对?一个kei对应一个freq,应该是频率的意思!重写了tostring方法!关键字加频率值。
package com.huaban.analysis.jieba;
public class SegToken {
public String word;
public int startOffset;
public int endOffset;
public SegToken(String word, int startOffset, int endOffset) {
this.word = word;
this.startOffset = startOffset;
this.endOffset = endOffset;
}
@Override
public String toString() {
return "[" + word + ", " + startOffset + ", " + endOffset + "]";
}
}
这个应该是,单词和起止位置的吧!