/** @generated * @param jcas JCas to which this Feature Structure belongs * @param begin offset to the begin spot in the SofA * @param end offset to the end spot in the SofA */ public Stem(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
Stem stemAnnot = new Stem(jcas, fs.getBegin(), fs.getEnd()); stemAnnot.setValue(stemValue); stemAnnot.addToIndexes(jcas); && jcas.getTypeSystem().subsumes(feat.getRange(), stemAnnot.getType())) { fs.setFeatureValue(feat, stemAnnot);
t1.setPos(p1); Stem s1 = new Stem(jcas, t1.getBegin(), t1.getEnd()); s1.setValue("stem1"); s1.addToIndexes(); t1.setStem(s1);
/** * @return the stem value if there is a {@link Stem} annotation linked to this token. */ public String getStemValue() { Stem stem = getStem(); return stem != null ? stem.getValue() : null; }
@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { for (Lemma lemma : select(aJCas, Lemma.class)) { Token t = selectSingleAt(aJCas, Token.class, lemma.getBegin(), lemma.getEnd()); assert t.getLemma() == lemma; } for (Stem stem : select(aJCas, Stem.class)) { Token t = selectSingleAt(aJCas, Token.class, stem.getBegin(), stem.getEnd()); assert t.getStem() == stem; } for (MorphologicalFeatures morph : select(aJCas, MorphologicalFeatures.class)) { Token t = selectSingleAt(aJCas, Token.class, morph.getBegin(), morph.getEnd()); assert t.getMorph() == morph; } for (POS pos : select(aJCas, POS.class)) { Token t = selectSingleAt(aJCas, Token.class, pos.getBegin(), pos.getEnd()); assert t.getPos() == pos; } for (Dependency dep : select(aJCas, Dependency.class)) { assert dep.getBegin() == dep.getDependent().getBegin(); assert dep.getEnd() == dep.getDependent().getEnd(); } } }
/** Internal - constructor used by generator * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public Stem(int addr, TOP_Type type) { super(addr, type); readObject(); }
stem.removeFromIndexes(); aMessages.add(new LogMessage(this, LogLevel.INFO, "Removed stem attached to token with illegal span: %s", t));
/** * @return the stem value if there is a {@link Stem} annotation linked to this token. */ public String getStemValue() { Stem stem = getStem(); return stem != null ? stem.getValue() : null; }
/** @generated * @param jcas JCas to which this Feature Structure belongs */ public Stem(JCas jcas) { super(jcas); readObject(); }
/** @generated * @param jcas JCas to which this Feature Structure belongs * @param begin offset to the begin spot in the SofA * @param end offset to the end spot in the SofA */ public Stem(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
public static void assertStem(String[] aExpected, Collection<Stem> aActual) { if (aExpected == null) { return; } List<String> expected = asList(aExpected); List<String> actual = new ArrayList<String>(); for (Stem a : aActual) { actual.add(a.getValue()); } System.out.printf("%-20s - Expected: %s%n", "Stems", asCopyableString(expected)); System.out.printf("%-20s - Actual : %s%n", "Stems", asCopyableString(actual)); assertEquals(asCopyableString(expected, true), asCopyableString(actual, true)); }
/** Internal - constructor used by generator * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public Stem(int addr, TOP_Type type) { super(addr, type); readObject(); }
public static void assertStem(String[] aExpected, Collection<Stem> aActual) { if (aExpected == null) { return; } List<String> expected = asList(aExpected); List<String> actual = new ArrayList<String>(); for (Stem a : aActual) { actual.add(a.getValue()); } System.out.printf("%-20s - Expected: %s%n", "Stems", asCopyableString(expected)); System.out.printf("%-20s - Actual : %s%n", "Stems", asCopyableString(actual)); assertEquals(asCopyableString(expected, true), asCopyableString(actual, true)); }
/** @generated * @param jcas JCas to which this Feature Structure belongs */ public Stem(JCas jcas) { super(jcas); readObject(); }