use of de.tudarmstadt.ukp.clarin.webanno.constraints.model.Condition in project webanno by webanno.
the class ConditionVisitorTest method test.
@Test
public void test() throws Exception {
ConstraintsGrammar parser = new ConstraintsGrammar(new FileInputStream("src/test/resources/rules/6.rules"));
Parse p = parser.Parse();
List<Condition> conditions = new ArrayList<>();
p.accept(new ConditionVisitor(), conditions);
for (Condition cond : conditions) {
System.out.printf("%s %n", cond);
}
}
use of de.tudarmstadt.ukp.clarin.webanno.constraints.model.Condition in project webanno by webanno.
the class ConditionVisitor method visit.
@Override
public void visit(de.tudarmstadt.ukp.clarin.webanno.constraints.grammar.syntaxtree.Condition aN, List<Condition> aArgu) {
path = null;
value = QuoteUtil.unquote(aN.f2.tokenImage);
super.visit(aN, aArgu);
aArgu.add(new Condition(path, value));
}
use of de.tudarmstadt.ukp.clarin.webanno.constraints.model.Condition in project webanno by webanno.
the class RuleVisitor method visit.
@Override
public void visit(RuleDeclaration aN, List<Rule> aArgu) {
List<Condition> conditions = new ArrayList<>();
List<Restriction> restrictions = new ArrayList<>();
// super.visit(aN, aArgu);
aN.accept(new ConditionVisitor(), conditions);
aN.accept(new RestrictionVisitor(), restrictions);
aArgu.add(new Rule(conditions, restrictions));
}
Aggregations