Exemplo n.º 1
0
 @Override
 public boolean match(FeatureStructure ref, FeatureStructure cand) {
   if (!subtypeMatch) {
     return ref.getType().equals(cand.getType());
   } else {
     TypeSystem ts = ref.getCAS().getTypeSystem();
     return ts.subsumes(ref.getType(), cand.getType());
   }
 }
Exemplo n.º 2
0
  private List<AnnotationFS> collectLinks(FeatureStructure aChain) {
    List<AnnotationFS> links = new ArrayList<AnnotationFS>();

    // Now we seek the link within the current chain
    AnnotationFS linkFs =
        (AnnotationFS)
            aChain.getFeatureValue(aChain.getType().getFeatureByBaseName(chainFirstFeatureName));
    while (linkFs != null) {
      links.add(linkFs);

      linkFs = getNextLink(linkFs);
    }

    return links;
  }
Exemplo n.º 3
0
 /** Get the first link of a chain from the chain head feature structure. */
 private AnnotationFS getFirstLink(FeatureStructure aChain) {
   return (AnnotationFS)
       aChain.getFeatureValue(aChain.getType().getFeatureByBaseName(chainFirstFeatureName));
 }
Exemplo n.º 4
0
 /** Set the first link of a chain in the chain head feature structure. */
 private void setFirstLink(FeatureStructure aChain, AnnotationFS aLink) {
   aChain.setFeatureValue(aChain.getType().getFeatureByBaseName(chainFirstFeatureName), aLink);
 }