/** @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 NGram(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
private List<NGram> getNGrams(List<T> tokenList, int k) { List<NGram> nGrams = new ArrayList<NGram>(); int size = tokenList.size(); for (int i = 0; i < (size + 1 - k); i++) { try { NGram ngram = new NGram(tokenList.get(i).getCAS().getJCas(), tokenList.get(i) .getBegin(), tokenList.get(i + k - 1).getEnd()); ngram.setText(getTokenText(tokenList, i, i + k - 1)); nGrams.add(ngram); } catch (CASException e) { throw new IllegalStateException(e); } } return nGrams; }
/** Internal - constructor used by generator * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public NGram(int addr, TOP_Type type) { super(addr, type); readObject(); }
@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { for (Sentence s : select(aJCas, Sentence.class)) { for (NGram ngram : NGramIterable.create(selectCovered(Token.class, s), n)) { ngram.addToIndexes(); } } } }
private List<NGram> getNGrams(List<T> tokenList, int k) { List<NGram> nGrams = new ArrayList<NGram>(); int size = tokenList.size(); for (int i = 0; i < (size + 1 - k); i++) { try { NGram ngram = new NGram(tokenList.get(i).getCAS().getJCas(), tokenList.get(i) .getBegin(), tokenList.get(i + k - 1).getEnd()); ngram.setText(getTokenText(tokenList, i, i + k - 1)); nGrams.add(ngram); } catch (CASException e) { throw new IllegalStateException(e); } } return nGrams; }
/** @generated * @param jcas JCas to which this Feature Structure belongs */ public NGram(JCas jcas) { super(jcas); readObject(); }
@Override public void process(JCas aJCas) throws AnalysisEngineProcessException { for (Sentence s : select(aJCas, Sentence.class)) { for (NGram ngram : NGramIterable.create(selectCovered(Token.class, s), n)) { ngram.addToIndexes(); } } } }
/** @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 NGram(JCas jcas, int begin, int end) { super(jcas); setBegin(begin); setEnd(end); readObject(); }
/** Internal - constructor used by generator * @generated * @param addr low level Feature Structure reference * @param type the type of this Feature Structure */ public NGram(int addr, TOP_Type type) { super(addr, type); readObject(); }
/** @generated * @param jcas JCas to which this Feature Structure belongs */ public NGram(JCas jcas) { super(jcas); readObject(); }