Search in sources :

Example 1 with TaskRule

use of nars.task.util.TaskRule in project narchy by automenta.

the class JsonTermTest method testJsonArray.

@Test
public void testJsonArray() throws Narsese.NarseseException {
    NAR d = new NARS().get();
    d.log();
    new TaskRule("(json,%1):{x(%2)}", "X(%1,%2)", d);
    // d.believe( $.inh( JsonCompound.the("['a', 1, ['b', 'c']]"), $.the("(json,1)")  ) );
    // TaskProcess: $.50;.95$ (("a"),(1),(("b"),("c"))). %1.0;.90% {0: 1}
    d.believe($.inh(JsonTerm.the("{ x: 3, y: [\"a\",4] }"), $.$("(json,2)")));
    // d.believe( $.inh( JsonCompound.the("{ x: 3 }"), $.$("(json,2)") ) );
    // $.15;.86$ X(3,2). %1.0;.81% {1: 1;;}
    // $.50;.95$ {x(3),y(("a"),("b"))}. %1.0;.90% {0: 2}
    d.run(256);
}
Also used : NARS(nars.NARS) TaskRule(nars.task.util.TaskRule) NAR(nars.NAR) Test(org.junit.jupiter.api.Test)

Aggregations

NAR (nars.NAR)1 NARS (nars.NARS)1 TaskRule (nars.task.util.TaskRule)1 Test (org.junit.jupiter.api.Test)1