use of org.omegat.gui.glossary.GlossaryEntry in project omegat by omegat-org.
the class TaaSGlossary method search.
@Override
public List<GlossaryEntry> search(Language sLang, Language tLang, String srcText) throws Exception {
if (!Preferences.isPreferenceDefault(Preferences.TAAS_LOOKUP, false) || !TaaSPlugin.getClient().isAllowed()) {
return Collections.emptyList();
}
TaasExtractionResult res = TaaSPlugin.getClient().termExtraction(sLang, tLang, srcText, Preferences.getPreference(Preferences.TAAS_DOMAIN));
String data = TaaSPlugin.filterTaasResult(res.getTerms());
List<GlossaryEntry> entries = GlossaryReaderTBX.read(data, false, OStrings.getString("TAAS_GLOSSARY_NAME"));
Log.logDebug(LOGGER, "TaaS returns {0} glossary entries", entries.size());
return entries;
}
Aggregations