/** * Get the selector path of the structure annotation covering the given annotation * * @param annotation the annotation * @return the selector path in this hierarchy covering the given annotation */ public SelectorPath generatePath(Annotation annotation) { Optional<Structure> covering = getCoveringStructure(annotation); Node<Structure> node = getRoot(); if (covering.isPresent()) { node = getIndex().get(covering.get()); } return new SelectorPath(node.toPath()); }
/** * Get the selector path of the structure annotation covering the given annotation * * @param annotation the annotation * @return the selector path in this hierarchy covering the given annotation */ public SelectorPath generatePath(Annotation annotation) { Optional<Structure> covering = getCoveringStructure(annotation); Node<Structure> node = getRoot(); if (covering.isPresent()) { node = getIndex().get(covering.get()); } return new SelectorPath(node.toPath()); }
.max(Comparator.comparingInt(Structure::getDepth)); Optional<Structure> coveringStructure = structureHierarchy.getCoveringStructure(recordDefinition); Optional<Structure> endStructure = JCasUtil.selectCovering(