public abstract class AbstractTemplateParallelTextService extends AbstractLanguageService implements TemplateParallelTextService
ALL_MATCHINGMETHODS, EMPTY_LANGUAGEPAIRS, EMPTY_LANGUAGEPATHS, EMPTY_LANGUAGES, MINIMUM_MATCHINGMETHODS
Constructor and Description |
---|
AbstractTemplateParallelTextService() |
AbstractTemplateParallelTextService(Collection<Language> supportedLanguages)
Constructor.
|
AbstractTemplateParallelTextService(ServiceContext context) |
Modifier and Type | Method and Description |
---|---|
protected abstract String |
doGenerateSentence(Language language,
String templateId,
BoundChoiceParameter[] boundChoiceParameters,
BoundValueParameter[] boundRangeParameters) |
protected abstract String[] |
doGetCategoryNames(String categoryId,
Language[] languages) |
protected abstract Template[] |
doGetTemplatesByTemplateId(Language language,
String[] templateIds) |
protected abstract Category[] |
doListTemplateCategories(Language language) |
protected abstract Template[] |
doSearchTemplates(Language language,
String text,
MatchingMethod matchingMethod,
String[] categoryIds) |
String |
generateSentence(String language,
String templateId,
BoundChoiceParameter[] boundChoiceParameters,
BoundValueParameter[] boundRangeParameters) |
String[] |
getCategoryNames(String categoryId,
String[] languages) |
Template[] |
getTemplatesByTemplateId(String language,
String[] templateIds) |
protected MatchingMethod |
getValidMatchingMethod(String parameterName,
String matchingMethod) |
Category[] |
listTemplateCategories(String language) |
Template[] |
searchTemplates(String language,
String text,
String matchingMethod,
String[] categoryIds) |
getSupportedLanguageCollection, getSupportedLanguagePairCollection, getSupportedLanguages, setSupportedLanguageCollection, setSupportedLanguages
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 AbstractTemplateParallelTextService()
public AbstractTemplateParallelTextService(ServiceContext context)
public AbstractTemplateParallelTextService(Collection<Language> supportedLanguages)
supportedPairs
- Set of supported language pairspublic Category[] listTemplateCategories(String language) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, NoValidEndpointsException, ProcessFailedException, ServerBusyException, ServiceNotActiveException, ServiceNotFoundException, UnsupportedLanguageException
listTemplateCategories
in interface TemplateParallelTextService
AccessLimitExceededException
InvalidParameterException
NoAccessPermissionException
NoValidEndpointsException
ProcessFailedException
ServerBusyException
ServiceNotActiveException
ServiceNotFoundException
UnsupportedLanguageException
public String[] getCategoryNames(String categoryId, String[] languages) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, NoValidEndpointsException, ProcessFailedException, ServerBusyException, ServiceNotActiveException, ServiceNotFoundException, UnsupportedLanguageException
getCategoryNames
in interface TemplateParallelTextService
AccessLimitExceededException
InvalidParameterException
NoAccessPermissionException
NoValidEndpointsException
ProcessFailedException
ServerBusyException
ServiceNotActiveException
ServiceNotFoundException
UnsupportedLanguageException
public Template[] searchTemplates(String language, String text, String matchingMethod, String[] categoryIds) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, NoValidEndpointsException, ProcessFailedException, ServerBusyException, ServiceNotActiveException, ServiceNotFoundException, UnsupportedLanguageException, UnsupportedMatchingMethodException
searchTemplates
in interface TemplateParallelTextService
AccessLimitExceededException
InvalidParameterException
NoAccessPermissionException
NoValidEndpointsException
ProcessFailedException
ServerBusyException
ServiceNotActiveException
ServiceNotFoundException
UnsupportedLanguageException
UnsupportedMatchingMethodException
public Template[] getTemplatesByTemplateId(String language, String[] templateIds) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, NoValidEndpointsException, ProcessFailedException, ServerBusyException, ServiceNotActiveException, ServiceNotFoundException, UnsupportedLanguageException
getTemplatesByTemplateId
in interface TemplateParallelTextService
AccessLimitExceededException
InvalidParameterException
NoAccessPermissionException
NoValidEndpointsException
ProcessFailedException
ServerBusyException
ServiceNotActiveException
ServiceNotFoundException
UnsupportedLanguageException
public String generateSentence(String language, String templateId, BoundChoiceParameter[] boundChoiceParameters, BoundValueParameter[] boundRangeParameters) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, NoValidEndpointsException, ProcessFailedException, ServerBusyException, ServiceNotActiveException, ServiceNotFoundException, UnsupportedLanguageException
generateSentence
in interface TemplateParallelTextService
AccessLimitExceededException
InvalidParameterException
NoAccessPermissionException
NoValidEndpointsException
ProcessFailedException
ServerBusyException
ServiceNotActiveException
ServiceNotFoundException
UnsupportedLanguageException
protected abstract Category[] doListTemplateCategories(Language language) throws InvalidParameterException, ProcessFailedException
protected abstract String[] doGetCategoryNames(String categoryId, Language[] languages) throws InvalidParameterException, ProcessFailedException
protected abstract Template[] doSearchTemplates(Language language, String text, MatchingMethod matchingMethod, String[] categoryIds) throws InvalidParameterException, ProcessFailedException
protected abstract Template[] doGetTemplatesByTemplateId(Language language, String[] templateIds) throws InvalidParameterException, ProcessFailedException
protected abstract String doGenerateSentence(Language language, String templateId, BoundChoiceParameter[] boundChoiceParameters, BoundValueParameter[] boundRangeParameters) throws InvalidParameterException, ProcessFailedException
protected MatchingMethod getValidMatchingMethod(String parameterName, String matchingMethod) throws InvalidParameterException
InvalidParameterException