/** @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 Lemma(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
LemmataEntry.Lemma lemma = lemmaCollection.iterator().next(); String lem = lemma.getLemma(); Lemma jcoreLemma = new Lemma(aJCas, token.getBegin(), token.getEnd()); jcoreLemma.setValue(lem); token.setLemma(jcoreLemma); } else { Lemma jcoreLemma = new Lemma(aJCas, token.getBegin(), token.getEnd()); jcoreLemma.setValue(tokenString); token.setLemma(jcoreLemma);
/** @generated * @param jcas JCas to which this Feature Structure belongs */ public Lemma(JCas jcas) { super(jcas); readObject(); }
public TokenSequence getLemmata(JCas aJCas) { TokenSequence lemmata = new TokenSequence(); AnnotationIndex<Annotation> tokenIndex = aJCas.getAnnotationIndex(Token.type); FSIterator<Annotation> tokenIterator = tokenIndex.iterator(); while (tokenIterator.hasNext()) { Token token = (Token) tokenIterator.get(); Lemma lemma = token.getLemma(); if (lemma == null) throw new IllegalArgumentException("The input UIMA CAS is missing lemma annotations set to the tokens as the lemma feature."); String lemmaString = lemma.getValue(); if (isNotNum(lemmaString) && isNotPunctuation(lemmaString)) { lemmata.add(lemmaString); } tokenIterator.next(); } return lemmata; }
/** Internal - constructor used by generator * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public Lemma(int addr, TOP_Type type) { super(addr, type); readObject(); }