@Override public String toString() { return this.getTokenizedSurfaceForm(); }
@Override public String toString() { return this.getTokenizedSurfaceForm(); }
@Override public Set<Feature> getFeatures(Constituent c) throws EdisonException { Set<Feature> feature = new LinkedHashSet<>(); if (c.getTokenizedSurfaceForm().matches(regex)) feature.add(matches); return feature; }
@Override public Set<Feature> getFeatures(Constituent c) throws EdisonException { Set<Feature> feature = new LinkedHashSet<>(); if (c.getTokenizedSurfaceForm().matches(regex)) feature.add(matches); return feature; }
@Override public Set<Feature> getFeatures(Constituent c) throws EdisonException { String surface = c.getTokenizedSurfaceForm().trim(); if (!caseSensitive) surface = surface.toLowerCase(); Set<Feature> features = new LinkedHashSet<>(); if (list.contains(surface)) features.add(listName); return features; }
@Override public Set<Feature> getFeatures(Constituent c) throws EdisonException { String surface = c.getTokenizedSurfaceForm().trim(); if (!caseSensitive) surface = surface.toLowerCase(); Set<Feature> features = new LinkedHashSet<>(); if (list.contains(surface)) features.add(listName); return features; }
@Override public String getTokenizedText() { initializeTokens(); return sentenceConstituent.getTokenizedSurfaceForm(); }
@Override public String getTokenizedText() { initializeTokens(); return sentenceConstituent.getTokenizedSurfaceForm(); }
@Override public String toString() { List<Constituent> constituents = new ArrayList<>(this.getConstituents()); Collections.sort(constituents, TextAnnotationUtilities.constituentStartComparator); StringBuilder sb = new StringBuilder(); for (Constituent c : constituents) sb.append("[").append(c.getLabel()).append(" ").append(c.getTokenizedSurfaceForm()) .append(" ] "); return sb.toString(); } }
@Override public String toString() { List<Constituent> constituents = new ArrayList<>(this.getConstituents()); Collections.sort(constituents, TextAnnotationUtilities.constituentStartComparator); StringBuilder sb = new StringBuilder(); for (Constituent c : constituents) sb.append("[").append(c.getLabel()).append(" ").append(c.getTokenizedSurfaceForm()) .append(" ] "); return sb.toString(); } }
public String getPredicateLemma(Constituent predicate) { if (predicate.hasAttribute(LemmaIdentifier)) return predicate.getAttribute(LemmaIdentifier); else return predicate.getTokenizedSurfaceForm().toLowerCase().trim(); }
@Override public Set<Feature> getFeatures(Constituent c) throws EdisonException { return FeatureUtilities.prefix(c.getTokenizedSurfaceForm().toLowerCase().trim(), base.getFeatures(c)); }
public String getPredicateLemma(Constituent predicate) { if (predicate.hasAttribute(LemmaIdentifier)) return predicate.getAttribute(LemmaIdentifier); else return predicate.getTokenizedSurfaceForm().toLowerCase().trim(); }
@Override public Set<Feature> getFeatures(Constituent c) throws EdisonException { return FeatureUtilities.prefix(c.getTokenizedSurfaceForm().toLowerCase().trim(), base.getFeatures(c)); }
private String getWord(TextAnnotation ta, int token) { return ta.getView(ViewNames.TOKENS).getConstituentsCoveringToken(token).get(0) .getTokenizedSurfaceForm(); }
private String getWord(TextAnnotation ta, int token) { return ta.getView(ViewNames.TOKENS).getConstituentsCoveringToken(token).get(0) .getTokenizedSurfaceForm(); }
protected String getNERString() { List<Constituent> constituents = new ArrayList<>(view.getConstituents()); Collections.sort(constituents, TextAnnotationUtilities.constituentStartComparator); StringBuilder sb = new StringBuilder(); String text = textAnnotation.getText(); int where = 0; for (Constituent c : constituents) { int start = c.getStartCharOffset(); String startstring = text.substring(where, start); sb.append(startstring).append("[").append(c.getLabel()).append(" ") .append(c.getTokenizedSurfaceForm()).append(" ] "); where = c.getEndCharOffset(); } return sb.toString(); } }
protected String getNERString() { List<Constituent> constituents = new ArrayList<>(view.getConstituents()); Collections.sort(constituents, TextAnnotationUtilities.constituentStartComparator); StringBuilder sb = new StringBuilder(); String text = textAnnotation.getText(); int where = 0; for (Constituent c : constituents) { int start = c.getStartCharOffset(); String startstring = text.substring(where, start); sb.append(startstring).append("[").append(c.getLabel()).append(" ") .append(c.getTokenizedSurfaceForm()).append(" ] "); where = c.getEndCharOffset(); } return sb.toString(); } }
@Override public Set<Feature> getFeatures(Constituent c) throws EdisonException { final int wordPosition; if (c.size() != 1) { if (useLastWordOfMultiwordConstituents) wordPosition = c.getEndSpan() - 1; else throw new EdisonException("Input \"" + c.getTokenizedSurfaceForm() + "\" to WordFeatureExtractor is not a single word. "); } else wordPosition = c.getStartSpan(); return getWordFeatures(c.getTextAnnotation(), wordPosition); }
@Override public Set<Feature> getFeatures(Constituent c) throws EdisonException { final int wordPosition; if (c.size() != 1) { if (useLastWordOfMultiwordConstituents) wordPosition = c.getEndSpan() - 1; else throw new EdisonException("Input \"" + c.getTokenizedSurfaceForm() + "\" to WordFeatureExtractor is not a single word. "); } else wordPosition = c.getStartSpan(); return getWordFeatures(c.getTextAnnotation(), wordPosition); }