⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 substitutiontest.java

📁 该原代码是实现机器学习中条件随机场模型的Java代码
💻 JAVA
字号:
package lcrf.logic;

import junit.framework.TestCase;

public class SubstitutionTest extends TestCase {
    public void testsubstitution1() throws Exception {
        Atom a1 = new Atom("the(dog,is,good(X))");
        Atom a2 = new Atom("the(dog,is,good(  42  ))");

        Atom b1 = new Atom("the(X,X,good(X))");
        Atom b2 = new Atom("the(42,42,good(42))");

        Substitution subst = new Substitution(new Variable("X"), new NumberConstant(42));

        assertEquals(a2.getTermRepresentation(), subst.apply(a1.getTermRepresentation()));
        assertEquals(b2.getTermRepresentation(), subst.apply(b1.getTermRepresentation()));
    }

}

⌨️ 快捷键说明

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