public List<Feature> extract(JCas view, T focusAnnotation) throws CleartkExtractorException { Feature f = new Feature(); int c = JCasUtil.selectCovered(goalClass, focusAnnotation).size(); f.setValue(c); f.setName("count-" + goalClass.getSimpleName() + "-" + c); return Arrays.asList(f); }
public List<Feature> extract(JCas view, T focusAnnotation) throws CleartkExtractorException { List<Feature> flist = new LinkedList<Feature>(); for (Annotation anno : JCasUtil.select(view, goalClass)) { Feature f = new Feature(); f.setName("subtype"); f.setValue(anno.getType().getShortName()); flist.add(f); } return flist; }
List<Feature> extractNode(JCas jCas, TreebankNode node, boolean specialCasePP) throws CleartkExtractorException { List<Feature> features = subExtractor.extract(jCas, node); for (Feature feature : features) { feature.setName(createName(specialCasePP, feature)); } return features; }
public List<Feature> extract(JCas jCas, TreebankNode node) throws CleartkExtractorException { TreebankNode parent = node.getParent(); if (parent == null) return Collections.emptyList(); List<TreebankNode> children = Lists.newArrayList(JCasUtil.select( parent.getChildren(), TreebankNode.class)); int index = children.indexOf(node); int siblingIndex = index + offset; if (siblingIndex < 0 || siblingIndex >= children.size()) return Collections.emptyList(); TreebankNode sibling = children.get(siblingIndex); List<Feature> features = subExtractor.extract(jCas, sibling); for (Feature feature : features) { feature.setName(Feature.createName(name, feature.getName())); } return features; }
public List<Feature> extract(JCas view, T focusAnnotation) throws CleartkExtractorException { List<Feature> features = subExtractor.extract(view, focusAnnotation); for (Feature feature : features) { feature.setName(Feature.createName(name, feature.getName())); } return features; }
/** * @param outcome * the outcome of the returned instance * @param featureData * space delimited features. Here the features only have names (no values) corresponding * to the space delimited strings. * @return a single instance with the provided outcome and name-only string features found in the * provided featureData */ public static <T> Instance<T> createInstance(T outcome, String featureData) { Instance<T> instance = new Instance<T>(outcome); String[] columns = featureData.split(" "); for (int i = 0; i < columns.length; i++) { Feature feature = new Feature(); feature.setName(columns[i]); instance.add(feature); } return instance; }
public List<Feature> extract(JCas jCas, TreebankNode node) throws CleartkExtractorException { TreebankNode parent = node.getParent(); if (parent == null) return Collections.emptyList(); List<Feature> features = subExtractor.extract(jCas, parent); for (Feature feature : features) { feature.setName(Feature.createName("Parent", feature.getName())); } return features; }
for(Feature feat : mentionFeatures){ if(feat.getName() != null){ feat.setName("DUMMYLINK_" + feat.getName());
for(Feature feat : mentionFeatures){ if(feat.getName() != null){ feat.setName("DUMMYLINK_" + feat.getName());