@SuppressWarnings("unchecked") private E getValue(FeatureStructure fs) { E featureValue = (E) fs.getFeatureValue(feature); return featureValue; } }
@Override protected Collection<String> getCollection(FST srcFS) { return FSUtils.toList((StringArrayFS) srcFS.getFeatureValue(feat)); } };
private void setValue(AnnotationFS target, String value) { FeatureStructure curElemAnno = target; for (int i = 0; i < featurePath.size() - 1; i++) { FeatureStructure featValue = curElemAnno.getFeatureValue(featurePath.get(i)); curElemAnno = featValue; } Feature lastFeature = featurePath.get(featurePath.size() - 1); curElemAnno.setStringValue(lastFeature, value); }
@Override @SuppressWarnings("unchecked") protected Collection<E> getCollection(FeatureStructure anno) { ArrayFS fsArray = (ArrayFS) anno.getFeatureValue(feature); if (fsArray == null) { return null; } return (Collection<E>) FSCollectionFactory.create(fsArray); } }
public boolean match(FeatureStructure fs) { // compile(((FeatureStructureImpl) fs).getCAS().getTypeSystem()); final int max = this.featNames.size(); for (int i = 0; i < max; i++) { Feature feat = fs.getType().getFeatureByBaseName(this.featNames.get(i)); if (feat == null) { return false; } fs = fs.getFeatureValue(feat); } return this.cons.match(fs); }
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; }
/** * 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)); }
/** * Get a feature value. * * @param aFS * the feature structure. * @param aFeatureName * the feature within the annotation whose value to set. */ public static FeatureStructure getFeatureFS(FeatureStructure aFS, String aFeatureName) { return aFS.getFeatureValue(aFS.getType().getFeatureByBaseName(aFeatureName)); } }
private List<AnnotationFS> collectLinks(FeatureStructure aChain) { List<AnnotationFS> links = new ArrayList<>(); // Now we seek the link within the current chain AnnotationFS linkFs = (AnnotationFS) aChain.getFeatureValue(aChain.getType() .getFeatureByBaseName(getChainFirstFeatureName())); while (linkFs != null) { links.add(linkFs); linkFs = getNextLink(linkFs); } return links; }
private List<AnnotationFS> collectLinks(FeatureStructure aChain) { List<AnnotationFS> links = new ArrayList<>(); // Now we seek the link within the current chain AnnotationFS linkFs = (AnnotationFS) aChain.getFeatureValue(aChain.getType() .getFeatureByBaseName(getChainFirstFeatureName())); while (linkFs != null) { links.add(linkFs); linkFs = getNextLink(linkFs); } return links; }
/** * Gets the value. * * @return the value */ public Object getValue() { if (mFeature.getRange().isPrimitive()) { return Primitives.getPrimitive(mStructure, mFeature); } return mStructure.getFeatureValue(mFeature); }
/** * 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( getChainFirstFeatureName())); }
/** * 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( getChainFirstFeatureName())); }
public static void collect(Set<FeatureStructure> aFSes, FeatureStructure aFS) { if (aFS != null && !aFSes.contains(aFS)) { aFSes.add(aFS); for (Feature f : aFS.getType().getFeatures()) { if (!f.getRange().isPrimitive() && !CAS.FEATURE_BASE_NAME_SOFA.equals(f.getShortName())) { collect(aFSes, aFS.getFeatureValue(f)); } } } }
public static void collect(Set<FeatureStructure> aFSes, FeatureStructure aFS) { if (aFS != null && !aFSes.contains(aFS)) { aFSes.add(aFS); for (Feature f : aFS.getType().getFeatures()) { if (!f.getRange().isPrimitive() && !CAS.FEATURE_BASE_NAME_SOFA.equals(f.getShortName())) { collect(aFSes, aFS.getFeatureValue(f)); } } } }
public static void collect(Set<FeatureStructure> aFSes, FeatureStructure aFS) { if (aFS != null && !aFSes.contains(aFS)) { aFSes.add(aFS); for (Feature f : aFS.getType().getFeatures()) { if (!f.getRange().isPrimitive() && !CAS.FEATURE_BASE_NAME_SOFA.equals(f.getShortName())) { collect(aFSes, aFS.getFeatureValue(f)); } } } }
@Override public List<LinkWithRoleModel> getFeatureValue(AnnotationFeature aFeature, FeatureStructure aFS) { Feature linkFeature = aFS.getType().getFeatureByBaseName(aFeature.getName()); return wrapFeatureValue(aFeature, aFS.getCAS(), aFS.getFeatureValue(linkFeature)); }
@Override public List<LinkWithRoleModel> getFeatureValue(AnnotationFeature aFeature, FeatureStructure aFS) { Feature linkFeature = aFS.getType().getFeatureByBaseName(aFeature.getName()); return wrapFeatureValue(aFeature, aFS.getCAS(), aFS.getFeatureValue(linkFeature)); }
@Override public List<LinkWithRoleModel> getFeatureValue(AnnotationFeature aFeature, FeatureStructure aFS) { Feature linkFeature = aFS.getType().getFeatureByBaseName(aFeature.getName()); return wrapFeatureValue(aFeature, aFS.getCAS(), aFS.getFeatureValue(linkFeature)); }
@Override public List<LinkWithRoleModel> getFeatureValue(AnnotationFeature aFeature, FeatureStructure aFS) { Feature linkFeature = aFS.getType().getFeatureByBaseName(aFeature.getName()); return wrapFeatureValue(aFeature, aFS.getCAS(), aFS.getFeatureValue(linkFeature)); }