public abstract class AbstractExampleBasedTranslationService extends AbstractLanguagePairService implements ExampleBasedTranslationService
ALL_MATCHINGMETHODS, EMPTY_LANGUAGEPAIRS, EMPTY_LANGUAGEPATHS, EMPTY_LANGUAGES, MINIMUM_MATCHINGMETHODS
Constructor and Description |
---|
AbstractExampleBasedTranslationService()
Constructor that doesn't take parameter(s).
|
AbstractExampleBasedTranslationService(ServiceContext serviceContext)
Constructor that takes the service context and supported language pair(s) as a parameter(s).
|
Modifier and Type | Method and Description |
---|---|
void |
appendExamples(String corpusId,
String sourceLang,
String targetLang,
ParallelText[] examples) |
String |
createTrainingCorpus(String sourceLang,
String targetLang,
ParallelText[] examples) |
void |
destroyTrainingCorpus(String corpusId) |
protected abstract void |
doAppendExamples(String corpusId,
Language sourceLang,
Language targetLang,
ParallelText[] examples) |
protected abstract String |
doCreateTrainingCorpus(Language sourceLang,
Language targetLang,
ParallelText[] examples) |
protected abstract void |
doDestroyTrainingCorpus(String corpusId) |
protected abstract TrainingCorpusInfo |
doGetTrainingCorpusInfo(String corpusId) |
protected abstract void |
doReplaceExamples(String corpusId,
Language sourceLang,
Language targetLang,
ParallelText[] examples) |
protected abstract String |
doTranslateWithTrainingCorpus(String[] corpusIds,
Language sourceLang,
Language targetLang,
String source) |
TrainingCorpusInfo |
getTrainingCorpusInfo(String corpusId) |
void |
replaceExamples(String corpusId,
String sourceLang,
String targetLang,
ParallelText[] examples) |
String |
translate(String sourceLang,
String targetLang,
String source) |
String |
translateWithTrainingCorpus(String[] corpusIds,
String sourceLang,
String targetLang,
String source) |
getSupportedLanguagePairCollection, getSupportedLanguagePairs, setSupportedLanguagePairs
acquireSemaphore, checkStartupException, convertLanguagePairs, convertLanguages, doGetLastUpdate, getCurrentServiceContext, getDoDoubleSearch, getEliminateDuplicates, getInitParameter, getInitParameterBoolean, getInitParameterInt, getInitParameterLong, getInitParameters, getInitParameterString, getInitParameterUsingTransformer, getLastUpdate, getLogListener, getMaxResults, getMaxWaitMillisForExternalProcess, getRequestMimeHeaders, getServiceContext, getWorkDirectory, getWorkFile, log, parseDateMacro, processEnd, processEnd, processLap, processStart, releaseSemaphore, setCurrentServiceContext, setDoubleSearchResults, setEliminateDuplicates, setLogListener, setMaxResults, setMaxThreads, setMaxWaitMillisForExternalProcess, setMaxWaitMillisForThread, setMeasureProcessTime, setProcessTimeWarningThreasholdMillis, setStartupException
getComponentServiceFactory, getFile, getServiceName, setComponentServiceFactory, setServiceName
public AbstractExampleBasedTranslationService()
public AbstractExampleBasedTranslationService(ServiceContext serviceContext)
serviceContext
- Service context
s *public String createTrainingCorpus(String sourceLang, String targetLang, ParallelText[] examples) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, ProcessFailedException, NoValidEndpointsException, ServerBusyException, ServiceNotActiveException, ServiceNotFoundException, UnsupportedLanguagePairException
createTrainingCorpus
in interface ExampleBasedTranslationService
AccessLimitExceededException
InvalidParameterException
NoAccessPermissionException
ProcessFailedException
NoValidEndpointsException
ServerBusyException
ServiceNotActiveException
ServiceNotFoundException
UnsupportedLanguagePairException
public void destroyTrainingCorpus(String corpusId) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, ProcessFailedException, NoValidEndpointsException, ServerBusyException, ServiceNotActiveException, ServiceNotFoundException
public TrainingCorpusInfo getTrainingCorpusInfo(String corpusId) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, ProcessFailedException, NoValidEndpointsException, ServerBusyException, ServiceNotActiveException, ServiceNotFoundException
public void appendExamples(String corpusId, String sourceLang, String targetLang, ParallelText[] examples) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, ProcessFailedException, NoValidEndpointsException, ServerBusyException, ServiceNotActiveException, ServiceNotFoundException, UnsupportedLanguagePairException
appendExamples
in interface ExampleBasedTranslationService
AccessLimitExceededException
InvalidParameterException
NoAccessPermissionException
ProcessFailedException
NoValidEndpointsException
ServerBusyException
ServiceNotActiveException
ServiceNotFoundException
UnsupportedLanguagePairException
public void replaceExamples(String corpusId, String sourceLang, String targetLang, ParallelText[] examples) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, ProcessFailedException, NoValidEndpointsException, ServerBusyException, ServiceNotActiveException, ServiceNotFoundException, UnsupportedLanguagePairException
replaceExamples
in interface ExampleBasedTranslationService
AccessLimitExceededException
InvalidParameterException
NoAccessPermissionException
ProcessFailedException
NoValidEndpointsException
ServerBusyException
ServiceNotActiveException
ServiceNotFoundException
UnsupportedLanguagePairException
public String translate(String sourceLang, String targetLang, String source) throws AccessLimitExceededException, InvalidParameterException, LanguagePairNotUniquelyDecidedException, NoAccessPermissionException, NoValidEndpointsException, ProcessFailedException, ServerBusyException, ServiceNotActiveException, ServiceNotFoundException, UnsupportedLanguagePairException
translate
in interface ExampleBasedTranslationService
AccessLimitExceededException
InvalidParameterException
LanguagePairNotUniquelyDecidedException
NoAccessPermissionException
NoValidEndpointsException
ProcessFailedException
ServerBusyException
ServiceNotActiveException
ServiceNotFoundException
UnsupportedLanguagePairException
public String translateWithTrainingCorpus(String[] corpusIds, String sourceLang, String targetLang, String source) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, ProcessFailedException, NoValidEndpointsException, ServerBusyException, ServiceNotActiveException, ServiceNotFoundException, UnsupportedLanguagePairException
translateWithTrainingCorpus
in interface ExampleBasedTranslationService
AccessLimitExceededException
InvalidParameterException
NoAccessPermissionException
ProcessFailedException
NoValidEndpointsException
ServerBusyException
ServiceNotActiveException
ServiceNotFoundException
UnsupportedLanguagePairException
protected abstract String doCreateTrainingCorpus(Language sourceLang, Language targetLang, ParallelText[] examples) throws InvalidParameterException, ProcessFailedException
protected abstract void doDestroyTrainingCorpus(String corpusId) throws InvalidParameterException, ProcessFailedException
protected abstract TrainingCorpusInfo doGetTrainingCorpusInfo(String corpusId) throws InvalidParameterException, ProcessFailedException
protected abstract void doAppendExamples(String corpusId, Language sourceLang, Language targetLang, ParallelText[] examples) throws InvalidParameterException, ProcessFailedException
protected abstract void doReplaceExamples(String corpusId, Language sourceLang, Language targetLang, ParallelText[] examples) throws InvalidParameterException, ProcessFailedException
protected abstract String doTranslateWithTrainingCorpus(String[] corpusIds, Language sourceLang, Language targetLang, String source) throws InvalidParameterException, ProcessFailedException