public abstract class AbstractBilingualDictionaryService extends AbstractLanguagePairService implements BilingualDictionaryService
ALL_MATCHINGMETHODS, EMPTY_LANGUAGEPAIRS, EMPTY_LANGUAGEPATHS, EMPTY_LANGUAGES, MINIMUM_MATCHINGMETHODS
Constructor and Description |
---|
AbstractBilingualDictionaryService()
Constructor.
|
AbstractBilingualDictionaryService(Collection<LanguagePair> supportedPairs)
Constructor.
|
AbstractBilingualDictionaryService(ServiceContext context)
Constructor.
|
AbstractBilingualDictionaryService(ServiceContext context,
Collection<LanguagePair> supportedPairs)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract Collection<Translation> |
doSearch(Language headLang,
Language targetLang,
String headWord,
MatchingMethod matchingMethod) |
protected Translation[] |
doubleSearch(Translation[] result,
String headWord,
MatchingMethod matchingMethod) |
String[] |
getSupportedMatchingMethods()
Returns the search methods supported by the dictionary wrapper.
|
Translation[] |
search(String headLang,
String targetLang,
String headWord,
String matchingMethod)
Searches the bilingual dictionary using the specified search term(s) and matching method, and returns bilingual translation.
|
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLastUpdate, getSupportedLanguagePairs
public AbstractBilingualDictionaryService()
public AbstractBilingualDictionaryService(ServiceContext context)
context
- Service contextpublic AbstractBilingualDictionaryService(Collection<LanguagePair> supportedPairs)
supportedPairs
- Set of supported language pairspublic AbstractBilingualDictionaryService(ServiceContext context, Collection<LanguagePair> supportedPairs)
context
- Service contextsupportedPairs
- Set of supported language pairspublic Translation[] search(String headLang, String targetLang, String headWord, String matchingMethod) throws AccessLimitExceededException, InvalidParameterException, LanguagePairNotUniquelyDecidedException, NoAccessPermissionException, NoValidEndpointsException, ProcessFailedException, ServerBusyException, ServiceNotActiveException, ServiceNotFoundException, UnsupportedLanguagePairException, UnsupportedMatchingMethodException
BilingualDictionaryService
search
in interface BilingualDictionaryService
headLang
- Source language of bilingual translation(RFC3066 compliant)targetLang
- Target language of bilingual translation (RFC3066 compliant)headWord
- Bilingual translation search phrasematchingMethod
- Matching method (one of either "COMPLETE","PREFIX","SUFFIX","PARTIAL","REGEX")AccessLimitExceededException
- Violated an access restrictionInvalidParameterException
- One of either headLang,targetLang,searchMethod is null or else is an empty string. headLang or targetLang do not comply with RFC3066.String not provided for by searchMethodLanguagePairNotUniquelyDecidedException
- The bilingual translation language pair candidates could not be singly resolved(Ex:When headLang, or else targetLang is specified as zh, the case where zh-Hans and zh-Hant both exist as supported language pairs)UnsupportedLanguagePairException
- 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 foundpublic String[] getSupportedMatchingMethods() throws AccessLimitExceededException, NoAccessPermissionException, NoValidEndpointsException, ProcessFailedException, ServerBusyException, ServiceNotActiveException, ServiceNotFoundException
BilingualDictionaryService
getSupportedMatchingMethods
in interface BilingualDictionaryService
AccessLimitExceededException
- Violated an access restrictionNoAccessPermissionException
- 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 void setSupportedMatchingMethods(Set<MatchingMethod> supportedMatchingMethods)
protected Translation[] doubleSearch(Translation[] result, String headWord, MatchingMethod matchingMethod)
protected abstract Collection<Translation> doSearch(Language headLang, Language targetLang, String headWord, MatchingMethod matchingMethod) throws InvalidParameterException, ProcessFailedException