use of annis.model.QueryNode in project ANNIS by korpling.
the class JoinListener method enterCommonancestor.
@Override
public void enterCommonancestor(AqlParser.CommonancestorContext ctx) {
QueryNode left = relationChain.get(relationIdx);
QueryNode right = relationChain.get(relationIdx + 1);
String label = ctx.label == null ? null : ctx.label.getText();
left.addOutgoingJoin(addParsedLocation(ctx, new CommonAncestor(right, label)));
}
use of annis.model.QueryNode in project ANNIS by korpling.
the class JoinListener method enterDirectPrecedence.
@Override
public void enterDirectPrecedence(AqlParser.DirectPrecedenceContext ctx) {
QueryNode left = relationChain.get(relationIdx);
QueryNode right = relationChain.get(relationIdx + 1);
String segmentationName = null;
if (ctx.NAMED_PRECEDENCE() != null) {
segmentationName = ctx.NAMED_PRECEDENCE().getText().substring(1);
}
left.addOutgoingJoin(addParsedLocation(ctx, new Precedence(right, 1, segmentationName)));
}
use of annis.model.QueryNode in project ANNIS by korpling.
the class JoinListener method enterEqualvalue.
@Override
public void enterEqualvalue(AqlParser.EqualvalueContext ctx) {
QueryNode left = relationChain.get(relationIdx);
QueryNode right = relationChain.get(relationIdx + 1);
left.addOutgoingJoin(addParsedLocation(ctx, new EqualValue(right)));
}
use of annis.model.QueryNode in project ANNIS by korpling.
the class JoinListener method enterRangePointing.
@Override
public void enterRangePointing(AqlParser.RangePointingContext ctx) {
QueryNode left = relationChain.get(relationIdx);
QueryNode right = relationChain.get(relationIdx + 1);
String label = getLayerName(ctx.POINTING(), 2);
QueryNode.Range range = annisRangeFromARangeSpec(ctx.rangeSpec());
if (range.getMin() == 0 || range.getMax() == 0) {
throw new AnnisQLSemanticsException(AnnisParserAntlr.getLocation(ctx.getStart(), ctx.getStop()), "Distance can't be 0");
} else if (range.getMin() > range.getMax()) {
throw new AnnisQLSemanticsException(AnnisParserAntlr.getLocation(ctx.getStart(), ctx.getStop()), "Minimal distance can't be larger than maximal distance");
}
left.addOutgoingJoin(addParsedLocation(ctx, new PointingRelation(right, label, range.getMin(), range.getMax())));
}
use of annis.model.QueryNode in project ANNIS by korpling.
the class QueryNodeListener method enterTokOnlyExpr.
@Override
public void enterTokOnlyExpr(AqlParser.TokOnlyExprContext ctx) {
QueryNode target = newNode(ctx);
target.setToken(true);
}
Aggregations