use of com.sri.ai.grinder.core.DefaultRegistry in project aic-expresso by aic-sri-international.
the class AssignmentsIteratorTest method test1.
@Test
public void test1() {
Registry registry = new DefaultRegistry();
Type myType = new Categorical("People", 4, arrayList(makeSymbol("oscar"), makeSymbol("mary")));
Symbol x = makeSymbol("X");
Symbol y = makeSymbol("Y");
String expected = "{X=oscar, Y=oscar}\n" + "{X=mary, Y=oscar}\n" + "{X=people3, Y=oscar}\n" + "{X=people4, Y=oscar}\n" + "{X=oscar, Y=mary}\n" + "{X=mary, Y=mary}\n" + "{X=people3, Y=mary}\n" + "{X=people4, Y=mary}\n" + "{X=oscar, Y=people3}\n" + "{X=mary, Y=people3}\n" + "{X=people3, Y=people3}\n" + "{X=people4, Y=people3}\n" + "{X=oscar, Y=people4}\n" + "{X=mary, Y=people4}\n" + "{X=people3, Y=people4}\n" + "{X=people4, Y=people4}";
Symbol myTypeExpression = makeSymbol(myType.getName());
registry = registry.makeNewContextWithAddedType(myType);
registry = registry.makeCloneWithAdditionalRegisteredSymbolsAndTypes(map(x, myTypeExpression, y, myTypeExpression));
AssignmentMapsIterator assignmentsIterator = new AssignmentMapsIterator(list(x, y), registry);
String actual = join("\n", assignmentsIterator);
// System.out.println(actual);
assertEquals(expected, actual);
}
Aggregations