public abstract class Seg extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Dictionary |
dic |
| Constructor and Description |
|---|
Seg(Dictionary dic) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
isUnit(int codePoint) |
protected int |
maxMatch(CharNode[] cns,
int cnIdx,
char[] chs,
int offset)
最大匹配
从 chs[offset] 开始匹配, 同时把 chs[offset] 的字符结点保存在 cns[cnIdx] |
protected void |
maxMatch(CharNode[] cns,
int cnIdx,
char[] chs,
int offset,
ArrayList<Integer>[] tailLens,
int tailLensIdx)
匹配,同时找出长度.
|
protected void |
printChunk(List<Chunk> chunks)
输出 chunks, 调试用.
|
protected int |
search(char[] chs,
int offset,
int tailLen)
查找chs[offset]后面的 tailLen个char是否为词.
|
protected int |
search(CharNode cn,
char[] chs,
int offset,
int tailLen)
没有数组的复制.
|
abstract Chunk |
seg(Sentence sen)
对句子 sen 进行分词.
|
protected Dictionary dic
public Seg(Dictionary dic)
protected boolean isUnit(int codePoint)
Dictionary.isUnit(Character)protected int search(char[] chs,
int offset,
int tailLen)
protected int search(CharNode cn, char[] chs, int offset, int tailLen)
protected int maxMatch(CharNode[] cns, int cnIdx, char[] chs, int offset)
protected void maxMatch(CharNode[] cns, int cnIdx, char[] chs, int offset, ArrayList<Integer>[] tailLens, int tailLensIdx)
Copyright © 2015-2016 Ganshane Developer Team. All Rights Reserved.