public class RelatedTerms extends SemanticProcessor implements com.exalead.util.Checkable, java.io.Serializable
SemanticProcessor.FromDataModel, SemanticProcessor.Transformer<T>, SemanticProcessor.Visitor
Modifier and Type | Field and Description |
---|---|
java.lang.String |
blacklistResource |
static boolean |
DEFAULT_KEEP_LONGEST_MATCH |
static int |
DEFAULT_MAX_RELATED_TERMS_PER_DOC |
static int |
DEFAULT_RELATED_TERMS_MAX_SPAN |
static int |
DEFAULT_RELATED_TERMS_MIN_SPAN |
static boolean |
DEFAULT_WITH_PART_OF_SPEECH |
java.lang.String |
dictionaryName |
boolean |
keepLongestMatch |
int |
maxRelatedTermsPerDoc |
java.lang.String |
preprocResourceDir |
int |
relatedTermsMaxSpan |
int |
relatedTermsMinSpan |
java.lang.String |
whitelistResource |
boolean |
withPartOfSpeech |
contexts, dataModelClass, dataModelProperty, dataModelState, DEFAULT_DISABLED, disabled, fromDataModel, name
Constructor and Description |
---|
RelatedTerms() |
RelatedTerms(RelatedTerms 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 RelatedTerms.
|
static RelatedTerms |
fromString(java.lang.String s)
String representation of this RelatedTerms.
|
java.lang.String |
getBlacklistResource()
Path to a related terms blocklist resource.
|
java.lang.String |
getDictionaryName()
Name of the dictionary populated by terms extracted by this processor.
If null, use the default dictionary. |
int |
getMaxRelatedTermsPerDoc()
The maximum number of related terms per document.
|
java.lang.String |
getPreprocResourceDir()
URL for the resource of the related terms preprocessor (data://, file;// or resource://).
If null, we use the standard preprocessor of the product. |
int |
getRelatedTermsMaxSpan()
Maximum number of words (excluding stop words) in an automatically extracted term (not applicable to allow list).
|
int |
getRelatedTermsMinSpan()
Minimum number of words (excluding stop words) in an automatically extracted term (not applicable to allow list).
|
java.lang.String |
getWhitelistResource()
Path to a related terms allow list resource.
|
boolean |
isKeepLongestMatch()
Keeps only the longest term when several overlap.
For example, if you have 5 tokens ('a', 'b', 'c', 'd', 'e') and 4 related terms 'a', 'a-c', 'b-c-d' and 'd-e', this option will only keep 'b-c-d' and remove all other related terms. |
boolean |
isWithPartOfSpeech()
Adds a PartOfSpeechTagger to the list of processors automatically.
|
RelatedTerms |
makeCopy()
Creates and returns a deep copy of this RelatedTerms.
|
static RelatedTerms |
readFrom(java.io.InputStream is)
Read this RelatedTerms from an XML fragment.
|
void |
setBlacklistResource(java.lang.String blacklistResource)
Path to a related terms blocklist resource.
|
void |
setDictionaryName(java.lang.String dictionaryName)
Name of the dictionary populated by terms extracted by this processor.
If null, use the default dictionary. |
void |
setKeepLongestMatch(boolean keepLongestMatch)
Keeps only the longest term when several overlap.
For example, if you have 5 tokens ('a', 'b', 'c', 'd', 'e') and 4 related terms 'a', 'a-c', 'b-c-d' and 'd-e', this option will only keep 'b-c-d' and remove all other related terms. |
void |
setMaxRelatedTermsPerDoc(int maxRelatedTermsPerDoc)
The maximum number of related terms per document.
|
void |
setPreprocResourceDir(java.lang.String preprocResourceDir)
URL for the resource of the related terms preprocessor (data://, file;// or resource://).
If null, we use the standard preprocessor of the product. |
void |
setRelatedTermsMaxSpan(int relatedTermsMaxSpan)
Maximum number of words (excluding stop words) in an automatically extracted term (not applicable to allow list).
|
void |
setRelatedTermsMinSpan(int relatedTermsMinSpan)
Minimum number of words (excluding stop words) in an automatically extracted term (not applicable to allow list).
|
void |
setWhitelistResource(java.lang.String whitelistResource)
Path to a related terms allow list resource.
|
void |
setWithPartOfSpeech(boolean withPartOfSpeech)
Adds a PartOfSpeechTagger to the list of processors automatically.
|
java.lang.String |
toString()
String representation of this RelatedTerms.
|
RelatedTerms |
withBlacklistResource(java.lang.String blacklistResource) |
RelatedTerms |
withContexts(java.lang.String contexts) |
RelatedTerms |
withDataModelClass(java.lang.String dataModelClass) |
RelatedTerms |
withDataModelProperty(java.lang.String dataModelProperty) |
RelatedTerms |
withDataModelState(java.lang.String dataModelState) |
RelatedTerms |
withDictionaryName(java.lang.String dictionaryName) |
RelatedTerms |
withDisabled(boolean disabled) |
RelatedTerms |
withDisabled(java.lang.Boolean disabled) |
RelatedTerms |
withFromDataModel(SemanticProcessor fromDataModel) |
RelatedTerms |
withKeepLongestMatch(boolean keepLongestMatch) |
RelatedTerms |
withKeepLongestMatch(java.lang.Boolean keepLongestMatch) |
RelatedTerms |
withMaxRelatedTermsPerDoc(int maxRelatedTermsPerDoc) |
RelatedTerms |
withMaxRelatedTermsPerDoc(java.lang.Integer maxRelatedTermsPerDoc) |
RelatedTerms |
withName(java.lang.String name) |
RelatedTerms |
withPreprocResourceDir(java.lang.String preprocResourceDir) |
RelatedTerms |
withRelatedTermsMaxSpan(int relatedTermsMaxSpan) |
RelatedTerms |
withRelatedTermsMaxSpan(java.lang.Integer relatedTermsMaxSpan) |
RelatedTerms |
withRelatedTermsMinSpan(int relatedTermsMinSpan) |
RelatedTerms |
withRelatedTermsMinSpan(java.lang.Integer relatedTermsMinSpan) |
RelatedTerms |
withWhitelistResource(java.lang.String whitelistResource) |
RelatedTerms |
withWithPartOfSpeech(boolean withPartOfSpeech) |
RelatedTerms |
withWithPartOfSpeech(java.lang.Boolean withPartOfSpeech) |
void |
writeTo(java.io.OutputStream os)
Write this RelatedTerms as an XML fragment
|
getContexts, getDataModelClass, getDataModelProperty, getDataModelState, getFromDataModel, getName, isDisabled, setContexts, setDataModelClass, setDataModelProperty, setDataModelState, setDisabled, setFromDataModel, setName
public int relatedTermsMinSpan
public static final int DEFAULT_RELATED_TERMS_MIN_SPAN
public int relatedTermsMaxSpan
public static final int DEFAULT_RELATED_TERMS_MAX_SPAN
public int maxRelatedTermsPerDoc
public static final int DEFAULT_MAX_RELATED_TERMS_PER_DOC
public boolean keepLongestMatch
public static final boolean DEFAULT_KEEP_LONGEST_MATCH
public java.lang.String dictionaryName
public java.lang.String preprocResourceDir
public java.lang.String whitelistResource
public java.lang.String blacklistResource
public boolean withPartOfSpeech
public static final boolean DEFAULT_WITH_PART_OF_SPEECH
public RelatedTerms()
public RelatedTerms(RelatedTerms o)
public RelatedTerms withName(java.lang.String name)
withName
in class SemanticProcessor
public RelatedTerms withContexts(java.lang.String contexts)
withContexts
in class SemanticProcessor
public RelatedTerms withFromDataModel(SemanticProcessor fromDataModel)
public RelatedTerms withDataModelState(java.lang.String dataModelState)
withDataModelState
in class SemanticProcessor
public RelatedTerms withDataModelClass(java.lang.String dataModelClass)
withDataModelClass
in class SemanticProcessor
public RelatedTerms withDataModelProperty(java.lang.String dataModelProperty)
withDataModelProperty
in class SemanticProcessor
public RelatedTerms withDisabled(boolean disabled)
withDisabled
in class SemanticProcessor
public RelatedTerms withDisabled(java.lang.Boolean disabled)
withDisabled
in class SemanticProcessor
public void setRelatedTermsMinSpan(int relatedTermsMinSpan)
public int getRelatedTermsMinSpan()
public RelatedTerms withRelatedTermsMinSpan(int relatedTermsMinSpan)
public RelatedTerms withRelatedTermsMinSpan(java.lang.Integer relatedTermsMinSpan)
public void setRelatedTermsMaxSpan(int relatedTermsMaxSpan)
public int getRelatedTermsMaxSpan()
public RelatedTerms withRelatedTermsMaxSpan(int relatedTermsMaxSpan)
public RelatedTerms withRelatedTermsMaxSpan(java.lang.Integer relatedTermsMaxSpan)
public void setMaxRelatedTermsPerDoc(int maxRelatedTermsPerDoc)
public int getMaxRelatedTermsPerDoc()
public RelatedTerms withMaxRelatedTermsPerDoc(int maxRelatedTermsPerDoc)
public RelatedTerms withMaxRelatedTermsPerDoc(java.lang.Integer maxRelatedTermsPerDoc)
public void setKeepLongestMatch(boolean keepLongestMatch)
public boolean isKeepLongestMatch()
public RelatedTerms withKeepLongestMatch(boolean keepLongestMatch)
public RelatedTerms withKeepLongestMatch(java.lang.Boolean keepLongestMatch)
public void setDictionaryName(java.lang.String dictionaryName)
public java.lang.String getDictionaryName()
public RelatedTerms withDictionaryName(java.lang.String dictionaryName)
public void setPreprocResourceDir(java.lang.String preprocResourceDir)
public java.lang.String getPreprocResourceDir()
public RelatedTerms withPreprocResourceDir(java.lang.String preprocResourceDir)
public void setWhitelistResource(java.lang.String whitelistResource)
public java.lang.String getWhitelistResource()
public RelatedTerms withWhitelistResource(java.lang.String whitelistResource)
public void setBlacklistResource(java.lang.String blacklistResource)
public java.lang.String getBlacklistResource()
public RelatedTerms withBlacklistResource(java.lang.String blacklistResource)
public void setWithPartOfSpeech(boolean withPartOfSpeech)
public boolean isWithPartOfSpeech()
public RelatedTerms withWithPartOfSpeech(boolean withPartOfSpeech)
public RelatedTerms withWithPartOfSpeech(java.lang.Boolean withPartOfSpeech)
public RelatedTerms makeCopy()
makeCopy
in class SemanticProcessor
public static RelatedTerms 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 RelatedTerms 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 © 2021 Dassault Systèmes, All Rights Reserved.