interpretationtest.java

来自「该原代码是实现机器学习中条件随机场模型的Java代码」· Java 代码 · 共 23 行

JAVA
23
字号
package lcrf.logic;

import junit.framework.TestCase;

public class InterpretationTest extends TestCase {
    
    public void testConstructor() throws Exception {
        Interpretation i1 = new Interpretation();
        
        assertEquals(null,i1.contains(new Atom("tomato").getTermRepresentation(),new Substitutions()));
        
        i1.add(new Atom("tomato"));
        
        assertEquals(new Substitutions(),i1.contains(new Atom("tomato").getTermRepresentation(),new Substitutions()));
        
        Substitutions x = new Substitutions();
        x.add(new Substitution(new Variable("X"),(new Atom("tomato").getTermRepresentation())));
        
        assertEquals(x,i1.contains(new Atom("X").getTermRepresentation(),new Substitutions()));
    }
        
}

⌨️ 快捷键说明

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