use of nars.term.atom.Atomic in project narchy by automenta.
the class EllipsisTest method testEllipsisInMinArity.
@Test
public void testEllipsisInMinArity() {
Atomic a = Atomic.the("a");
Ellipsis b = new EllipsisOneOrMore($.varPattern(1));
for (Op o : Op.values()) {
if (o.minSize <= 1)
continue;
if (o.statement)
continue;
if (o != DIFFe && o != DIFFi) {
assertEquals(a, o.the(DTERNAL, a), o + " with normal term");
} else {
assertEquals(Null, o.the(DTERNAL, a));
}
assertEquals(o.statement ? VAR_PATTERN : o, o.the(DTERNAL, b).op(), o + " with ellipsis not reduced");
}
}
use of nars.term.atom.Atomic in project narchy by automenta.
the class JsonTermTest method testBigJSON.
@Test
public void testBigJSON() {
NAR d = new NARS().get();
// d.log();
int n = 0;
for (String json : new String[] { "{\"coord\":{\"lon\":-0.13,\"lat\":51.51},\"weather\":[{\"id\":300,\"main\":\"Drizzle\",\"description\":\"light intensity drizzle\",\"icon\":\"09d\"}],\"base\":\"stations\",\"main\":{\"temp\":280.32,\"pressure\":1012,\"humidity\":81,\"temp_min\":279.15,\"temp_max\":281.15},\"visibility\":10000,\"wind\":{\"speed\":4.1,\"deg\":80},\"clouds\":{\"all\":90},\"dt\":1485789600,\"sys\":{\"type\":1,\"id\":5091,\"message\":0.0103,\"country\":\"GB\",\"sunrise\":1485762037,\"sunset\":1485794875},\"id\":2643743,\"name\":\"London\",\"cod\":200}", "{\"coord\":{\"lon\":139.01,\"lat\":35.02},\"weather\":[{\"id\":800,\"main\":\"Clear\",\"description\":\"clear sky\",\"icon\":\"01n\"}],\"base\":\"stations\",\"main\":{\"temp\":285.514,\"pressure\":1013.75,\"humidity\":100,\"temp_min\":285.514,\"temp_max\":285.514,\"sea_level\":1023.22,\"grnd_level\":1013.75},\"wind\":{\"speed\":5.52,\"deg\":311},\"clouds\":{\"all\":0},\"dt\":1485792967,\"sys\":{\"message\":0.0025,\"country\":\"JP\",\"sunrise\":1485726240,\"sunset\":1485763863},\"id\":1907296,\"name\":\"Tawarano\",\"cod\":200}" }) {
Atomic id = Atomic.the("WEATHER_" + (n++));
d.believe($.inh(JsonTerm.the(json), id), Tense.Eternal);
d.believe($.inst(id, Atomic.the("now")), Tense.Present);
}
d.run(256);
}
Aggregations