text2 = translator.translate(bridgeText2, bridgeLanguage.toString(), originalLanguage.toString());
System.out.println(text1);
} catch (IOException e) {
throw new SimilarityException(e);
}
// We now have to lemmatize again and pass the round-trip translated texts to
// the final similarity measure for comparison
Collection<String> lemmas1;
Collection<String> lemmas2;
try {
lemmas1 = getLemmas(text1);
lemmas2 = getLemmas(text2);
}
catch (AnalysisEngineProcessException e) {
throw new SimilarityException(e);
}
catch (ResourceInitializationException e) {
throw new SimilarityException(e);
}
return measure.getSimilarity(lemmas1, lemmas2);
}