public abstract class AbstractLanguageIdentificationService extends AbstractLanguageService implements LanguageIdentificationService
ALL_MATCHINGMETHODS, EMPTY_LANGUAGEPAIRS, EMPTY_LANGUAGEPATHS, EMPTY_LANGUAGES, MINIMUM_MATCHINGMETHODS
Constructor and Description |
---|
AbstractLanguageIdentificationService() |
Modifier and Type | Method and Description |
---|---|
protected abstract String |
doIdentify(String text,
String originalEncoding) |
protected abstract LanguageAndEncoding |
doIdentifyLanguageAndEncoding(byte[] textBytes) |
String[] |
getSupportedEncodings() |
String |
identify(String text,
String originalEncoding) |
LanguageAndEncoding |
identifyLanguageAndEncoding(byte[] textBytes) |
protected void |
setSupportedEncodings(String[] supportedEncodings) |
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSupportedLanguages
public AbstractLanguageIdentificationService()
public LanguageAndEncoding identifyLanguageAndEncoding(byte[] textBytes) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, NoValidEndpointsException, ProcessFailedException, ServerBusyException, ServiceNotActiveException, ServiceNotFoundException
identifyLanguageAndEncoding
in interface LanguageIdentificationService
AccessLimitExceededException
- Violated an access restrictionInvalidParameterException
- Either text or language is null or else an empty string.language does not comply with RFC3066NoAccessPermissionException
- The user executing the call lacks execution privilegesNoValidEndpointsException
- There is no valid endpointProcessFailedException
- Response search failed due to some causeServerBusyException
- The server is loaded and cannot process it.ServiceNotActiveException
- Service not activeServiceNotFoundException
- The specified service was not foundpublic String identify(String text, String originalEncoding) throws AccessLimitExceededException, InvalidParameterException, NoAccessPermissionException, NoValidEndpointsException, ProcessFailedException, ServerBusyException, ServiceNotActiveException, ServiceNotFoundException
identify
in interface LanguageIdentificationService
AccessLimitExceededException
- Violated an access restrictionInvalidParameterException
- Either text or language is null or else an empty string.language does not comply with RFC3066NoAccessPermissionException
- The user executing the call lacks execution privilegesNoValidEndpointsException
- There is no valid endpointProcessFailedException
- Response search failed due to some causeServerBusyException
- The server is loaded and cannot process it.ServiceNotActiveException
- Service not activeServiceNotFoundException
- The specified service was not foundpublic String[] getSupportedEncodings() throws NoValidEndpointsException, ProcessFailedException, ServerBusyException, ServiceNotActiveException, ServiceNotFoundException
getSupportedEncodings
in interface LanguageIdentificationService
NoValidEndpointsException
- There is no valid endpointProcessFailedException
- Response search failed due to some causeServerBusyException
- The server is loaded and cannot process it.ServiceNotActiveException
- Service not activeServiceNotFoundException
- The specified service was not foundprotected void setSupportedEncodings(String[] supportedEncodings)
protected abstract LanguageAndEncoding doIdentifyLanguageAndEncoding(byte[] textBytes) throws InvalidParameterException, ProcessFailedException
protected abstract String doIdentify(String text, String originalEncoding) throws InvalidParameterException, ProcessFailedException