int begin = node.getBegin(); int end = node.getEnd(); if(progeny.size() > 0){ for(ConllDependencyNode child : progeny){ if(child.getBegin() < begin){ begin = child.getBegin(); if(parent != null && parent.getId() != 0){ if(parent.getBegin() < node.getBegin() && parent.getBegin() > begin){ markable.addToIndexes(); }else if(node.getPostag().equals("DT") && !node.getDeprel().equals("det")){ Markable markable = new Markable(jCas, node.getBegin(), node.getEnd()); markable.addToIndexes(); }else if(node.getCoveredText().toLowerCase().equals("it") && node.getDeprel().contains("bj")){ Markable markable = new Markable(jCas, node.getBegin(), node.getEnd()); markable.addToIndexes();
markable.addToIndexes(); }else if(node.getPostag().equals("DT") && !node.getDeprel().equals("det")){ Markable markable = new Markable(jCas, node.getBegin(), node.getEnd()); markable.addToIndexes(); }else if(node.getCoveredText().toLowerCase().equals("it") && node.getDeprel().contains("bj")){ Markable markable = new Markable(jCas, node.getBegin(), node.getEnd()); markable.addToIndexes();
public String calcDepPath(){ if(depPath == null){ if(c1 == null || c2 == null || c2.getBegin() <= c1.getEnd()){ depPath = ""; }else{
/** * Finds the head word within a given annotation span */ public static ConllDependencyNode findAnnotationHead(JCas jcas, Annotation annotation) { for (ConllDependencyNode depNode : JCasUtil.selectCovered(jcas, ConllDependencyNode.class, annotation)) { ConllDependencyNode head = depNode.getHead(); if (head == null || head.getEnd() <= annotation.getBegin() || head.getBegin() > annotation.getEnd()) { // The head is outside the bounds of the annotation, so this node must be the annotation's head return depNode; } } // Can this happen? return null; }
public String calcDepPath(){ if(depPath == null){ if(c1 == null || c2 == null || c2.getBegin() <= c1.getEnd()){ depPath = ""; }else{
/** * Finds the head word within a given annotation span */ public static ConllDependencyNode findAnnotationHead(JCas jcas, Annotation annotation) { for (ConllDependencyNode depNode : JCasUtil.selectCovered(jcas, ConllDependencyNode.class, annotation)) { ConllDependencyNode head = depNode.getHead(); if (head == null || head.getEnd() <= annotation.getBegin() || head.getBegin() > annotation.getEnd()) { // The head is outside the bounds of the annotation, so this node must be the annotation's head return depNode; } } // Can this happen? return null; }
final Collection<IdentifiedAnnotation> annotations = nodeAnnotations.get( headNode ); if ( annotations == null || annotations.isEmpty() ) { spanMap.put( markable, new DefaultTextSpan( headNode.getBegin(), headNode.getEnd() ) ); continue; spanMap.put( markable, bestSpan ); } else { spanMap.put( markable, new DefaultTextSpan( headNode.getBegin(), headNode.getEnd() ) );
final Collection<IdentifiedAnnotation> annotations = nodeAnnotations.get( headNode ); if ( annotations == null || annotations.isEmpty() ) { spanMap.put( markable, new DefaultTextSpan( headNode.getBegin(), headNode.getEnd() ) ); continue; spanMap.put( markable, bestSpan ); } else { spanMap.put( markable, new DefaultTextSpan( headNode.getBegin(), headNode.getEnd() ) );