?? word.java
字號:
/**
*
*/
package org.solol.mmseg.internal;
import org.solol.mmseg.core.IWord;
/**
* @author solo L
*
*/
public class Word implements IWord {
private String value = "";
private int frequency = 0;
private int length = 0;
private int type = UNRECOGNIZED;
public Word(String value, int type) {
this.value = value;
this.type = type;
this.length = value.length();
}
public Word(String value, int frequency, int type) {
this(value, type);
this.frequency = frequency;
}
/*
* (non-Javadoc)
*
* @see org.solol.mmseg.core.IWord#getLength()
*/
public int getLength() {
return length;
}
public boolean equals(Object anObject) {
if (this == anObject) {
return true;
}
if (anObject instanceof IWord) {
IWord anotherWord = (IWord) anObject;
return anotherWord.getValue().equalsIgnoreCase(value);
}
return false;
}
public int hashCode() {
return value.hashCode();
}
public String getValue() {
return value;
}
public int getFrequency() {
return frequency;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -