public class Classifier extends SemanticProcessor implements com.exalead.util.Checkable, java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static interface |
Classifier.Transformer<T> |
static interface |
Classifier.Visitor |
SemanticProcessor.FromDataModel
Modifier and Type | Field and Description |
---|---|
boolean |
addAnnotationsOnKeywords |
java.lang.String |
annotationName |
boolean |
collapseToken |
static boolean |
DEFAULT_ADD_ANNOTATIONS_ON_KEYWORDS |
static boolean |
DEFAULT_COLLAPSE_TOKEN |
static java.lang.String |
DEFAULT_EXCLUDED_LANGUAGES |
static int |
DEFAULT_EXTRA_ANNOTATIONS_MIN_TRUST_LEVEL |
static java.lang.String |
DEFAULT_EXTRA_PREFIX_ANNOTATIONS |
static int |
DEFAULT_MAX_ANNOTATIONS |
static int |
DEFAULT_MAX_KEYWORDS |
static int |
DEFAULT_MIN_KEYWORDS |
static int |
DEFAULT_MIN_TRUST_LEVEL |
java.lang.String |
excludedLanguages |
int |
extraAnnotationsMinTrustLevel |
java.lang.String |
extraPrefixAnnotations |
java.lang.String |
language |
int |
maxAnnotations |
int |
maxKeywords |
int |
minKeywords |
int |
minTrustLevel |
java.lang.String |
resourceDir |
contexts, dataModelClass, dataModelProperty, dataModelState, DEFAULT_DISABLED, disabled, fromDataModel, name
Constructor and Description |
---|
Classifier() |
Classifier(Classifier o)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
<T> T |
accept(Classifier.Transformer<T> transformer,
T[] t) |
void |
accept(Classifier.Visitor visitor) |
<T> T |
accept(SemanticProcessor.Transformer<T> transformer,
T[] t) |
void |
accept(SemanticProcessor.Visitor visitor) |
void |
check(boolean deep,
java.lang.String errorContext)
Checks this Classifier.
|
static Classifier |
fromString(java.lang.String s)
String representation of this Classifier.
|
java.lang.String |
getAnnotationName()
Name of the annotation to add.
|
java.lang.String |
getExcludedLanguages()
Language for which the vocabulary classifier is deactivated (works only if language=xx, comma-separated).
|
int |
getExtraAnnotationsMinTrustLevel()
The minimum trust level to keep an extra annotation.
|
java.lang.String |
getExtraPrefixAnnotations()
The optional list of prefix annotations to keep (comma-separated).
|
java.lang.String |
getLanguage()
Language for which the vocabulary classifier is activated.
|
int |
getMaxAnnotations()
Maximum number of annotations per document.
|
int |
getMaxKeywords()
The maximum number of keywords to keep.
|
int |
getMinKeywords()
The minimum number of keywords per class.
|
int |
getMinTrustLevel()
The minimum trust level of categories to keep.
|
java.lang.String |
getResourceDir()
URL for the vocabulary resource (data://, file;// or resource://)
|
boolean |
isAddAnnotationsOnKeywords()
If true, it adds annotations to all matching tokens.
|
boolean |
isCollapseToken()
If true, all identical tokens are collapsed.
|
Classifier |
makeCopy()
Creates and returns a deep copy of this Classifier.
|
static Classifier |
readFrom(java.io.InputStream is)
Read this Classifier from an XML fragment.
|
void |
setAddAnnotationsOnKeywords(boolean addAnnotationsOnKeywords)
If true, it adds annotations to all matching tokens.
|
void |
setAnnotationName(java.lang.String annotationName)
Name of the annotation to add.
|
void |
setCollapseToken(boolean collapseToken)
If true, all identical tokens are collapsed.
|
void |
setExcludedLanguages(java.lang.String excludedLanguages)
Language for which the vocabulary classifier is deactivated (works only if language=xx, comma-separated).
|
void |
setExtraAnnotationsMinTrustLevel(int extraAnnotationsMinTrustLevel)
The minimum trust level to keep an extra annotation.
|
void |
setExtraPrefixAnnotations(java.lang.String extraPrefixAnnotations)
The optional list of prefix annotations to keep (comma-separated).
|
void |
setLanguage(java.lang.String language)
Language for which the vocabulary classifier is activated.
|
void |
setMaxAnnotations(int maxAnnotations)
Maximum number of annotations per document.
|
void |
setMaxKeywords(int maxKeywords)
The maximum number of keywords to keep.
|
void |
setMinKeywords(int minKeywords)
The minimum number of keywords per class.
|
void |
setMinTrustLevel(int minTrustLevel)
The minimum trust level of categories to keep.
|
void |
setResourceDir(java.lang.String resourceDir)
URL for the vocabulary resource (data://, file;// or resource://)
|
java.lang.String |
toString()
String representation of this Classifier.
|
Classifier |
withAddAnnotationsOnKeywords(boolean addAnnotationsOnKeywords) |
Classifier |
withAddAnnotationsOnKeywords(java.lang.Boolean addAnnotationsOnKeywords) |
Classifier |
withAnnotationName(java.lang.String annotationName) |
Classifier |
withCollapseToken(boolean collapseToken) |
Classifier |
withCollapseToken(java.lang.Boolean collapseToken) |
Classifier |
withContexts(java.lang.String contexts) |
Classifier |
withDataModelClass(java.lang.String dataModelClass) |
Classifier |
withDataModelProperty(java.lang.String dataModelProperty) |
Classifier |
withDataModelState(java.lang.String dataModelState) |
Classifier |
withDisabled(boolean disabled) |
Classifier |
withDisabled(java.lang.Boolean disabled) |
Classifier |
withExcludedLanguages(java.lang.String excludedLanguages) |
Classifier |
withExtraAnnotationsMinTrustLevel(int extraAnnotationsMinTrustLevel) |
Classifier |
withExtraAnnotationsMinTrustLevel(java.lang.Integer extraAnnotationsMinTrustLevel) |
Classifier |
withExtraPrefixAnnotations(java.lang.String extraPrefixAnnotations) |
Classifier |
withFromDataModel(SemanticProcessor fromDataModel) |
Classifier |
withLanguage(java.lang.String language) |
Classifier |
withMaxAnnotations(int maxAnnotations) |
Classifier |
withMaxAnnotations(java.lang.Integer maxAnnotations) |
Classifier |
withMaxKeywords(int maxKeywords) |
Classifier |
withMaxKeywords(java.lang.Integer maxKeywords) |
Classifier |
withMinKeywords(int minKeywords) |
Classifier |
withMinKeywords(java.lang.Integer minKeywords) |
Classifier |
withMinTrustLevel(int minTrustLevel) |
Classifier |
withMinTrustLevel(java.lang.Integer minTrustLevel) |
Classifier |
withName(java.lang.String name) |
Classifier |
withResourceDir(java.lang.String resourceDir) |
void |
writeTo(java.io.OutputStream os)
Write this Classifier as an XML fragment
|
getContexts, getDataModelClass, getDataModelProperty, getDataModelState, getFromDataModel, getName, isDisabled, setContexts, setDataModelClass, setDataModelProperty, setDataModelState, setDisabled, setFromDataModel, setName
public java.lang.String resourceDir
public java.lang.String annotationName
public java.lang.String language
public java.lang.String excludedLanguages
public static final java.lang.String DEFAULT_EXCLUDED_LANGUAGES
public boolean addAnnotationsOnKeywords
public static final boolean DEFAULT_ADD_ANNOTATIONS_ON_KEYWORDS
public int maxAnnotations
public static final int DEFAULT_MAX_ANNOTATIONS
public int minTrustLevel
public static final int DEFAULT_MIN_TRUST_LEVEL
public int maxKeywords
public static final int DEFAULT_MAX_KEYWORDS
public int minKeywords
public static final int DEFAULT_MIN_KEYWORDS
public boolean collapseToken
public static final boolean DEFAULT_COLLAPSE_TOKEN
public java.lang.String extraPrefixAnnotations
public static final java.lang.String DEFAULT_EXTRA_PREFIX_ANNOTATIONS
public int extraAnnotationsMinTrustLevel
public static final int DEFAULT_EXTRA_ANNOTATIONS_MIN_TRUST_LEVEL
public Classifier()
public Classifier(Classifier o)
public Classifier withName(java.lang.String name)
withName
in class SemanticProcessor
public Classifier withContexts(java.lang.String contexts)
withContexts
in class SemanticProcessor
public Classifier withFromDataModel(SemanticProcessor fromDataModel)
public Classifier withDataModelState(java.lang.String dataModelState)
withDataModelState
in class SemanticProcessor
public Classifier withDataModelClass(java.lang.String dataModelClass)
withDataModelClass
in class SemanticProcessor
public Classifier withDataModelProperty(java.lang.String dataModelProperty)
withDataModelProperty
in class SemanticProcessor
public Classifier withDisabled(boolean disabled)
withDisabled
in class SemanticProcessor
public Classifier withDisabled(java.lang.Boolean disabled)
withDisabled
in class SemanticProcessor
public void setResourceDir(java.lang.String resourceDir)
public java.lang.String getResourceDir()
public Classifier withResourceDir(java.lang.String resourceDir)
public void setAnnotationName(java.lang.String annotationName)
public java.lang.String getAnnotationName()
public Classifier withAnnotationName(java.lang.String annotationName)
public void setLanguage(java.lang.String language)
public java.lang.String getLanguage()
public Classifier withLanguage(java.lang.String language)
public void setExcludedLanguages(java.lang.String excludedLanguages)
public java.lang.String getExcludedLanguages()
public Classifier withExcludedLanguages(java.lang.String excludedLanguages)
public void setAddAnnotationsOnKeywords(boolean addAnnotationsOnKeywords)
public boolean isAddAnnotationsOnKeywords()
public Classifier withAddAnnotationsOnKeywords(boolean addAnnotationsOnKeywords)
public Classifier withAddAnnotationsOnKeywords(java.lang.Boolean addAnnotationsOnKeywords)
public void setMaxAnnotations(int maxAnnotations)
public int getMaxAnnotations()
public Classifier withMaxAnnotations(int maxAnnotations)
public Classifier withMaxAnnotations(java.lang.Integer maxAnnotations)
public void setMinTrustLevel(int minTrustLevel)
public int getMinTrustLevel()
public Classifier withMinTrustLevel(int minTrustLevel)
public Classifier withMinTrustLevel(java.lang.Integer minTrustLevel)
public void setMaxKeywords(int maxKeywords)
public int getMaxKeywords()
public Classifier withMaxKeywords(int maxKeywords)
public Classifier withMaxKeywords(java.lang.Integer maxKeywords)
public void setMinKeywords(int minKeywords)
public int getMinKeywords()
public Classifier withMinKeywords(int minKeywords)
public Classifier withMinKeywords(java.lang.Integer minKeywords)
public void setCollapseToken(boolean collapseToken)
public boolean isCollapseToken()
public Classifier withCollapseToken(boolean collapseToken)
public Classifier withCollapseToken(java.lang.Boolean collapseToken)
public void setExtraPrefixAnnotations(java.lang.String extraPrefixAnnotations)
public java.lang.String getExtraPrefixAnnotations()
public Classifier withExtraPrefixAnnotations(java.lang.String extraPrefixAnnotations)
public void setExtraAnnotationsMinTrustLevel(int extraAnnotationsMinTrustLevel)
public int getExtraAnnotationsMinTrustLevel()
public Classifier withExtraAnnotationsMinTrustLevel(int extraAnnotationsMinTrustLevel)
public Classifier withExtraAnnotationsMinTrustLevel(java.lang.Integer extraAnnotationsMinTrustLevel)
public Classifier makeCopy()
makeCopy
in class SemanticProcessor
public static Classifier 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 Classifier 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(Classifier.Visitor visitor) throws com.exalead.util.TypedException
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(Classifier.Transformer<T> transformer, T[] t) throws com.exalead.util.TypedException
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 © 2021 Dassault Systèmes, All Rights Reserved.