public abstract class BaseTerminologyConnector extends Object implements ITerminologyQuery, IGlossaryElementIdGenerator
ITerminologyQuery and IGlossaryElementIdGenerator.
Specific connectors would implement the following methods:
- ITerminologyQuery.getName()
- ITerminologyQuery.open()
- AutoCloseable.close()
- IGlossaryElementIdGenerator#generateGlossEntryId(int, int, Term)
- IGlossaryElementIdGenerator#generateGlossEntryTranslationId(int, int, Term, Translation)
- query(List)
To completely override how glossary is being formed for each segment, connector would
override populateSegmentsWithGlossary(int, Segment, Segment, List) method.
Also, it may be useful to override default behaviour of ITerminologyQuery.getSettingsDisplay() method.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
annotateSource |
protected boolean |
annotateTarget |
static String |
GLOSS_ENTRY_SEPARATOR_CHAR |
static String |
GLOSS_ENTRY_TRANSLATION_ID_SEPARATOR_CHAR |
protected LocaleId |
srcLoc |
protected LocaleId |
trgLoc |
| Constructor and Description |
|---|
BaseTerminologyConnector() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
getAnnotateSource() |
boolean |
getAnnotateTarget() |
IParameters |
getParameters() |
String |
getSettingsDisplay()
Gets a display representation of the current settings for this connector.
|
LocaleId |
getSourceLanguage() |
LocaleId |
getTargetLanguage() |
void |
leverage(ITextUnit unit) |
protected void |
populateSegmentsWithGlossary(int segmentIndex,
Segment sourceSegment,
Segment targetSegment,
List<TerminologyQueryResult> queryResults) |
protected abstract List<List<TerminologyQueryResult>> |
query(List<String> sourceSegments) |
void |
setAnnotateSource(boolean annotateSource) |
void |
setAnnotateTarget(boolean annotateTarget) |
void |
setLanguages(LocaleId sourceLocale,
LocaleId targetLocale) |
void |
setParameters(IParameters params) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetName, openclosegenerateGlossEntryId, generateGlossEntryTranslationIdpublic static String GLOSS_ENTRY_SEPARATOR_CHAR
public static String GLOSS_ENTRY_TRANSLATION_ID_SEPARATOR_CHAR
protected LocaleId srcLoc
protected LocaleId trgLoc
protected boolean annotateSource
protected boolean annotateTarget
protected abstract List<List<TerminologyQueryResult>> query(List<String> sourceSegments)
public LocaleId getSourceLanguage()
getSourceLanguage in interface ITerminologyQuerypublic LocaleId getTargetLanguage()
getTargetLanguage in interface ITerminologyQuerypublic boolean getAnnotateSource()
getAnnotateSource in interface ITerminologyQuerypublic boolean getAnnotateTarget()
getAnnotateTarget in interface ITerminologyQuerypublic void setAnnotateSource(boolean annotateSource)
setAnnotateSource in interface ITerminologyQuerypublic void setAnnotateTarget(boolean annotateTarget)
setAnnotateTarget in interface ITerminologyQuerypublic String getSettingsDisplay()
ITerminologyQuerygetSettingsDisplay in interface ITerminologyQuerypublic void setLanguages(LocaleId sourceLocale, LocaleId targetLocale)
setLanguages in interface ITerminologyQuerypublic IParameters getParameters()
getParameters in interface ITerminologyQuerypublic void setParameters(IParameters params)
setParameters in interface ITerminologyQuerypublic void leverage(ITextUnit unit)
leverage in interface ITerminologyQueryprotected void populateSegmentsWithGlossary(int segmentIndex,
Segment sourceSegment,
Segment targetSegment,
List<TerminologyQueryResult> queryResults)
Copyright © 2022. All rights reserved.