bncword.java

来自「一个关于CHATBOT的程序(人式智能方面)」· Java 代码 · 共 55 行

JAVA
55
字号
package ijp.assignment1.utils;import java.io.Serializable;/** * A data structure for storing information about word from the British National * Corpus (BNC). We only store the word and its frequency in the BNC * in this version. Note that this class is serializable - Objects * created from it can be read  * and written to disc for future use *  * @author Judy Robertson */public class BNCWord implements Serializable {    /**     * The word     */    private String word;        /**     * The frequency of the word in the BNC     */    private int frequency;    /**     * Sets the word     * @param w The word     */        public void setWord(String w) {        word = w;    }        /**     * Sets the frequency of this word     * @param f The frequency of this word in the Britsh National Corpus     */    public void setFrequency(int f) {        frequency = f;    }        /**     * Get the frequency of this word     * @return The frequency of this word in the British National Corpus     */    public int getFrequency() {        return frequency;    }        /**     * Gets the word     * @return the word     */    public String getWord() {        return word;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?