public abstract class AbstractParallelTextService extends AbstractLanguagePairService implements ParallelTextService
ALL_MATCHINGMETHODS, EMPTY_LANGUAGEPAIRS, EMPTY_LANGUAGEPATHS, EMPTY_LANGUAGES, MINIMUM_MATCHINGMETHODS
Constructor and Description |
---|
AbstractParallelTextService()
Constructor.
|
AbstractParallelTextService(Collection<LanguagePair> supportedPairs)
Constructor.
|
AbstractParallelTextService(ServiceContext serviceContext)
Constructor that takes the service context as a parameter.
|
AbstractParallelTextService(ServiceContext serviceContext,
Collection<LanguagePair> supportedPairs)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract Collection<ParallelText> |
doSearch(Language sourceLang,
Language targetLang,
String source,
MatchingMethod matchingMethod)
Runs a search.
|
String[] |
getSupportedMatchingMethods() |
protected LanguagePair |
getValidLanguagePair(String parameterName1,
String lang1,
String parameterName2,
String lang2) |
protected MatchingMethod |
getValidMatchingMethod(String parameterName,
String matchingMethod) |
ParallelText[] |
search(String sourceLang,
String targetLang,
String source,
String matchingMethod)
Runs a search on the parallel text using the specified search term(s) and matching method.
|
protected void |
setSupportedMatchingMethods(Set<MatchingMethod> supportedMatchingMethods) |
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 AbstractParallelTextService()
public AbstractParallelTextService(ServiceContext serviceContext)
serviceContext
- Service contextpublic AbstractParallelTextService(Collection<LanguagePair> supportedPairs)
supportedPairs
- Set of supported language pairspublic AbstractParallelTextService(ServiceContext serviceContext, Collection<LanguagePair> supportedPairs)
serviceContext
- Service contextsupportedPairs
- Supported language pairspublic ParallelText[] search(String sourceLang, String targetLang, String source, String matchingMethod) throws AccessLimitExceededException, InvalidParameterException, LanguagePairNotUniquelyDecidedException, NoAccessPermissionException, NoValidEndpointsException, ProcessFailedException, ServerBusyException, ServiceNotActiveException, ServiceNotFoundException, UnsupportedLanguagePairException, UnsupportedMatchingMethodException
ParallelTextService
search
in interface ParallelTextService
sourceLang
- Source language. RFC3066 complianttargetLang
- Language to search bilingual translation. RFC3066 compliantsource
- Sentence to search bilingual translation withmatchingMethod
- Search methodAccessLimitExceededException
- Violated an access restrictionInvalidParameterException
- An invalid parameter was passedLanguagePairNotUniquelyDecidedException
- Multiple candidate language pairs were foundUnsupportedLanguagePairException
- The specified language pair is not supported.UnsupportedMatchingMethodException
- The specified matching method is not supportedNoAccessPermissionException
- The user executing the call lacks execution privilegesNoValidEndpointsException
- There is no valid endpointProcessFailedException
- Search process failedServerBusyException
- The server is loaded and cannot process it.ServiceNotActiveException
- The service is not activeServiceNotFoundException
- The specified service was not foundprotected abstract Collection<ParallelText> doSearch(Language sourceLang, Language targetLang, String source, MatchingMethod matchingMethod) throws InvalidParameterException, ProcessFailedException
sourceLang
- Source languagetargetLang
- Target languagesource
- Keywords to be searchedmatchingMethod
- Matching methodInvalidParameterException
- An invalid parameter was passedProcessFailedException
- Process failedpublic String[] getSupportedMatchingMethods() throws AccessLimitExceededException, NoAccessPermissionException, NoValidEndpointsException, ProcessFailedException, ServerBusyException, ServiceNotActiveException, ServiceNotFoundException
protected void setSupportedMatchingMethods(Set<MatchingMethod> supportedMatchingMethods)
protected LanguagePair getValidLanguagePair(String parameterName1, String lang1, String parameterName2, String lang2) throws LanguagePairNotUniquelyDecidedException, UnsupportedLanguagePairException, InvalidParameterException
protected MatchingMethod getValidMatchingMethod(String parameterName, String matchingMethod) throws InvalidParameterException
InvalidParameterException