本文整理了Java中com.chenlb.mmseg4j.Word.<init>()
方法的一些代码示例,展示了Word.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Word.<init>()
方法的具体详情如下:
包路径:com.chenlb.mmseg4j.Word
类名称:Word
方法名:<init>
暂无
代码示例来源:origin: medcl/elasticsearch-analysis-mmseg
private Word createWord(StringBuilder bufSentence, int startIdx, String type) {
return new Word(toChars(bufSentence), startIdx, type);
}
代码示例来源:origin: com.chenlb.mmseg4j/mmseg4j-core
private Word createWord(StringBuilder bufSentence, int startIdx, String type) {
return new Word(toChars(bufSentence), startIdx, type);
}
代码示例来源:origin: chenlb/mmseg4j-core
private Word createWord(StringBuilder bufSentence, int startIdx, String type) {
return new Word(toChars(bufSentence), startIdx, type);
}
代码示例来源:origin: medcl/elasticsearch-analysis-mmseg
private Word createWord(StringBuilder bufSentence, String type) {
return new Word(toChars(bufSentence), startIdx(bufSentence), type);
}
代码示例来源:origin: com.chenlb.mmseg4j/mmseg4j-core
private Word createWord(StringBuilder bufSentence, String type) {
return new Word(toChars(bufSentence), startIdx(bufSentence), type);
}
代码示例来源:origin: chenlb/mmseg4j-core
private Word createWord(StringBuilder bufSentence, String type) {
return new Word(toChars(bufSentence), startIdx(bufSentence), type);
}
代码示例来源:origin: chenlb/mmseg4j-core
int idx = search(chs, offset, 1);
if(idx > -1) {
cks.add(new Word(chs, senStartOffset, offset, 2));
end = offset+2;
n++;
} else if(offset >= end) { //有单字
cks.add(new Word(chs, senStartOffset, offset, 1));
end = offset+1;
cks.add(new Word(chs, senStartOffset, offset, 1));
代码示例来源:origin: medcl/elasticsearch-analysis-mmseg
int idx = search(chs, offset, 1);
if(idx > -1) {
cks.add(new Word(chs, senStartOffset, offset, 2));
end = offset+2;
n++;
} else if(offset >= end) { //有单字
cks.add(new Word(chs, senStartOffset, offset, 1));
end = offset+1;
cks.add(new Word(chs, senStartOffset, offset, 1));
代码示例来源:origin: com.chenlb.mmseg4j/mmseg4j-core
int idx = search(chs, offset, 1);
if(idx > -1) {
cks.add(new Word(chs, senStartOffset, offset, 2));
end = offset+2;
n++;
} else if(offset >= end) { //有单字
cks.add(new Word(chs, senStartOffset, offset, 1));
end = offset+1;
cks.add(new Word(chs, senStartOffset, offset, 1));
代码示例来源:origin: medcl/elasticsearch-analysis-mmseg
private Chunk createChunk(Sentence sen, char[] chs, int[] tailLen, int[] offsets, CharNode[] cns/*, char[][] cks*/) {
Chunk ck = new Chunk();
for(int i=0; i<3; i++) {
if(offsets[i] < chs.length) {
ck.words[i] = new Word(chs, sen.getStartOffset(), offsets[i], tailLen[i]+1);//new Word(cks[i], sen.getStartOffset()+offsets[i]);
if(tailLen[i] == 0) { //单字的要取得"字频计算出自由度"
CharNode cn = cns[i]; //dic.head(chs[offsets[i]]);
if(cn !=null) {
ck.words[i].setDegree(cn.getFreq());
}
}
}
}
return ck;
}
代码示例来源:origin: com.chenlb.mmseg4j/mmseg4j-core
private Chunk createChunk(Sentence sen, char[] chs, int[] tailLen, int[] offsets, CharNode[] cns/*, char[][] cks*/) {
Chunk ck = new Chunk();
for(int i=0; i<3; i++) {
if(offsets[i] < chs.length) {
ck.words[i] = new Word(chs, sen.getStartOffset(), offsets[i], tailLen[i]+1);//new Word(cks[i], sen.getStartOffset()+offsets[i]);
if(tailLen[i] == 0) { //单字的要取得"字频计算出自由度"
CharNode cn = cns[i]; //dic.head(chs[offsets[i]]);
if(cn !=null) {
ck.words[i].setDegree(cn.getFreq());
}
}
}
}
return ck;
}
代码示例来源:origin: chenlb/mmseg4j-core
private Chunk createChunk(Sentence sen, char[] chs, int[] tailLen, int[] offsets, CharNode[] cns/*, char[][] cks*/) {
Chunk ck = new Chunk();
for(int i=0; i<3; i++) {
if(offsets[i] < chs.length) {
ck.words[i] = new Word(chs, sen.getStartOffset(), offsets[i], tailLen[i]+1);//new Word(cks[i], sen.getStartOffset()+offsets[i]);
if(tailLen[i] == 0) { //单字的要取得"字频计算出自由度"
CharNode cn = cns[i]; //dic.head(chs[offsets[i]]);
if(cn !=null) {
ck.words[i].setDegree(cn.getFreq());
}
}
}
}
return ck;
}
代码示例来源:origin: medcl/elasticsearch-analysis-mmseg
public Chunk seg(Sentence sen) {
Chunk chunk = new Chunk();
char[] chs = sen.getText();
for(int k=0; k<3&&!sen.isFinish(); k++) {
int offset = sen.getOffset();
int maxLen;
//有了 key tree 的支持可以从头开始 max match
maxLen = dic.maxMatch(chs, offset);
chunk.words[k] = new Word(chs, sen.getStartOffset(), offset, maxLen+1);
offset += maxLen + 1;
sen.setOffset(offset);
}
return chunk;
}
}
代码示例来源:origin: com.chenlb.mmseg4j/mmseg4j-core
public Chunk seg(Sentence sen) {
Chunk chunk = new Chunk();
char[] chs = sen.getText();
for(int k=0; k<3&&!sen.isFinish(); k++) {
int offset = sen.getOffset();
int maxLen = 0;
//有了 key tree 的支持可以从头开始 max match
maxLen = dic.maxMatch(chs, offset);
chunk.words[k] = new Word(chs, sen.getStartOffset(), offset, maxLen+1);
offset += maxLen + 1;
sen.setOffset(offset);
}
return chunk;
}
}
代码示例来源:origin: medcl/elasticsearch-analysis-mmseg
bufWord.add(new Word(new char[] {bufSentence.charAt(i)}, startIdx++, Word.TYPE_LETTER_NUMBER));
代码示例来源:origin: chenlb/mmseg4j-core
public Chunk seg(Sentence sen) {
Chunk chunk = new Chunk();
char[] chs = sen.getText();
for(int k=0; k<3&&!sen.isFinish(); k++) {
int offset = sen.getOffset();
int maxLen = 0;
//有了 key tree 的支持可以从头开始 max match
maxLen = dic.maxMatch(chs, offset);
chunk.words[k] = new Word(chs, sen.getStartOffset(), offset, maxLen+1);
offset += maxLen + 1;
sen.setOffset(offset);
}
return chunk;
}
}
代码示例来源:origin: com.chenlb.mmseg4j/mmseg4j-core
bufWord.add(new Word(new char[] {bufSentence.charAt(i)}, startIdx++, Word.TYPE_LETTER_NUMBER));
代码示例来源:origin: chenlb/mmseg4j-core
bufWord.add(new Word(new char[] {bufSentence.charAt(i)}, startIdx++, Word.TYPE_LETTER_NUMBER));
内容来源于网络,如有侵权,请联系作者删除!