/** * @param aCas * the <code>JCas</code> object * @return return whether it is an identical pair or not */ protected final boolean isIdenticalPair(JCas aCas) { FSIterator<TOP> iter = aCas.getJFSIndexRepository().getAllIndexedFS( Pair.type); if (iter.hasNext()) { Pair p = (Pair) iter.next(); String text = p.getText().getCoveredText(); String hypothesis = p.getHypothesis().getCoveredText(); if (text.trim().equals(hypothesis.trim())) { return true; } } // empty pair return false; }
/** * @param aCas * the <code>JCas</code> object * @return return whether it is an identical pair or not */ protected final boolean isIdenticalPair(JCas aCas) { FSIterator<TOP> iter = aCas.getJFSIndexRepository().getAllIndexedFS( Pair.type); if (iter.hasNext()) { Pair p = (Pair) iter.next(); String text = p.getText().getCoveredText(); String hypothesis = p.getHypothesis().getCoveredText(); if (text.trim().equals(hypothesis.trim())) { return true; } } // empty pair return false; }
"Text: " + pair.getText().getCoveredText() + "\n" + "Hypothesis: " + pair.getHypothesis().getCoveredText());
"Text: " + pair.getText().getCoveredText() + "\n" + "Hypothesis: " + pair.getHypothesis().getCoveredText());
String hypothesis = null; try { text = p.getText().getCoveredText();
TextHypothesisPair pair = new TextHypothesisPair(textAnno.getCoveredText(), hypothesisAnno.getCoveredText(), id, gold, null); return new PairData(pair, textTrees, hypothesisTree, mapTreesToSentences, coreferenceInformation);