sentencetemplate.java

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

JAVA
80
字号
package ijp.assignment1.langen;


/**
 * A data structure for representing templates for a template driven language 
 * generator.
 * 
 * @author Judy Robertson
 */
public class SentenceTemplate {
    
	/**
	 * The question sentence type
	 */
	public static String QUESTION= "question";
	
	/**
	 * The reply sentence type
	 */
	public static String REPLY ="reply";
	
	/**
	 * The type of sentence stored in this template
	 */
    
	private String sentenceType;
	/**
	 * A string representing this template
	 */
    
	private String template;
	
	/**
	 * Create a sentence template of the specified type, with the specified 
     * template representation
     * 
	 * @param type The type of this template e.g. QUESTION
     * 
	 * @param temp The string representation of this template
	 */
    
	public SentenceTemplate(String type, String temp){
		sentenceType = type;
		template = temp;
	}

	/**
	 * Gets the type of this sentence template
	 * @return the type
	 */
	public String getSentenceType() {
		return sentenceType;
	}

	/**
	 * Get the string representation of the template
	 * @return the template
	 */
	public String getTemplate() {
		return template;
	}

	/**
	 * Set the type of this sentence template
	 * @param string the type
	 */
	public void setSentenceType(String string) {
		sentenceType = string;
	}

	/**
	 * Set the string representation of this template
	 * @param string the template
	 */
	public void setTemplate(String string) {
		template = string;
	}

}

⌨️ 快捷键说明

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