public class LanguageDetector extends SemanticProcessor implements com.exalead.util.Checkable, java.io.Serializable
SemanticProcessor.Transformer<T>, SemanticProcessor.Visitor
Modifier and Type | Field and Description |
---|---|
boolean |
addDocumentAnnotation |
static boolean |
DEFAULT_ADD_DOCUMENT_ANNOTATION |
java.lang.String |
languagesToDetect |
java.lang.String |
resourceDir |
contexts, name, src
Constructor and Description |
---|
LanguageDetector() |
LanguageDetector(LanguageDetector o)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
<T> T |
accept(SemanticProcessor.Transformer<T> transformer,
T[] t) |
void |
accept(SemanticProcessor.Visitor visitor) |
void |
check(boolean deep,
java.lang.String errorContext)
Checks this LanguageDetector.
|
static LanguageDetector |
fromString(java.lang.String s)
String representation of this LanguageDetector.
|
java.lang.String |
getLanguagesToDetect()
List of languages to detect (comma-separated of ISO codes).
If the string is empty, detects all languages. |
java.lang.String |
getResourceDir()
URL for the resource (data://, file;// or resource://)
if null, use standard resource of product. |
boolean |
isAddDocumentAnnotation()
Adds annotations with tag="language" on the document with
displayForm = detect language (can produce multiple annotations) |
LanguageDetector |
makeCopy()
Creates and returns a deep copy of this LanguageDetector.
|
static LanguageDetector |
readFrom(java.io.InputStream is)
Read this LanguageDetector from an XML fragment.
|
void |
setAddDocumentAnnotation(boolean addDocumentAnnotation)
Adds annotations with tag="language" on the document with
displayForm = detect language (can produce multiple annotations) |
void |
setLanguagesToDetect(java.lang.String languagesToDetect)
List of languages to detect (comma-separated of ISO codes).
If the string is empty, detects all languages. |
void |
setResourceDir(java.lang.String resourceDir)
URL for the resource (data://, file;// or resource://)
if null, use standard resource of product. |
java.lang.String |
toString()
String representation of this LanguageDetector.
|
LanguageDetector |
withAddDocumentAnnotation(boolean addDocumentAnnotation) |
LanguageDetector |
withAddDocumentAnnotation(java.lang.Boolean addDocumentAnnotation) |
LanguageDetector |
withContexts(java.lang.String contexts) |
LanguageDetector |
withLanguagesToDetect(java.lang.String languagesToDetect) |
LanguageDetector |
withName(java.lang.String name) |
LanguageDetector |
withResourceDir(java.lang.String resourceDir) |
LanguageDetector |
withSrc(java.lang.String src)
Deprecated.
|
void |
writeTo(java.io.OutputStream os)
Write this LanguageDetector as an XML fragment
|
getContexts, getName, getSrc, setContexts, setName, setSrc
public java.lang.String resourceDir
public boolean addDocumentAnnotation
public static final boolean DEFAULT_ADD_DOCUMENT_ANNOTATION
public java.lang.String languagesToDetect
public LanguageDetector()
public LanguageDetector(LanguageDetector o)
public LanguageDetector withName(java.lang.String name)
withName
in class SemanticProcessor
public LanguageDetector withContexts(java.lang.String contexts)
withContexts
in class SemanticProcessor
@Deprecated public LanguageDetector withSrc(java.lang.String src)
withSrc
in class SemanticProcessor
public void setResourceDir(java.lang.String resourceDir)
public java.lang.String getResourceDir()
public LanguageDetector withResourceDir(java.lang.String resourceDir)
public void setAddDocumentAnnotation(boolean addDocumentAnnotation)
public boolean isAddDocumentAnnotation()
public LanguageDetector withAddDocumentAnnotation(boolean addDocumentAnnotation)
public LanguageDetector withAddDocumentAnnotation(java.lang.Boolean addDocumentAnnotation)
public void setLanguagesToDetect(java.lang.String languagesToDetect)
public java.lang.String getLanguagesToDetect()
public LanguageDetector withLanguagesToDetect(java.lang.String languagesToDetect)
public LanguageDetector makeCopy()
makeCopy
in class SemanticProcessor
public static LanguageDetector readFrom(java.io.InputStream is) throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBException
public void writeTo(java.io.OutputStream os) throws javax.xml.bind.JAXBException, java.io.IOException
writeTo
in class SemanticProcessor
javax.xml.bind.JAXBException
java.io.IOException
public static LanguageDetector fromString(java.lang.String s) throws javax.xml.bind.JAXBException, java.io.UnsupportedEncodingException
javax.xml.bind.JAXBException
java.io.UnsupportedEncodingException
public java.lang.String toString()
toString
in class SemanticProcessor
public void check(boolean deep, java.lang.String errorContext) throws com.exalead.util.TypedException
check
in interface com.exalead.util.Checkable
check
in class SemanticProcessor
com.exalead.util.TypedException
public void accept(SemanticProcessor.Visitor visitor) throws com.exalead.util.TypedException
accept
in class SemanticProcessor
com.exalead.util.TypedException
public <T> T accept(SemanticProcessor.Transformer<T> transformer, T[] t) throws com.exalead.util.TypedException
accept
in class SemanticProcessor
com.exalead.util.TypedException
Copyright © 2013 Dassault Systèmes, All Rights Reserved.