public class RelatedTermModule extends QueryExpansionModule implements com.exalead.util.Checkable, java.io.Serializable
QueryExpansionModule.Transformer<T>, QueryExpansionModule.Visitor
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_KEEP_LONGEST_MATCH |
static int |
DEFAULT_MAX_SPAN |
static int |
DEFAULT_MIN_SPAN |
static boolean |
DEFAULT_WITH_PART_OF_SPEECH |
boolean |
keepLongestMatch |
int |
maxSpan |
int |
minSpan |
boolean |
withPartOfSpeech |
name
Constructor and Description |
---|
RelatedTermModule() |
RelatedTermModule(RelatedTermModule o)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
<T> T |
accept(QueryExpansionModule.Transformer<T> transformer,
T[] t) |
void |
accept(QueryExpansionModule.Visitor visitor) |
void |
check(boolean deep,
java.lang.String errorContext)
Checks this RelatedTermModule.
|
static RelatedTermModule |
fromString(java.lang.String s)
String representation of this RelatedTermModule.
|
int |
getMaxSpan()
Maximal number of words (excluding stop words) in a generated related term.
|
int |
getMinSpan()
Minimum number of words (excluding stop words) in a generated related term.
|
boolean |
isKeepLongestMatch()
Keeps only the longest match.
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'. |
boolean |
isWithPartOfSpeech()
Automatically adds a PartOfSpeechTagger to the list of processors.
|
RelatedTermModule |
makeCopy()
Creates and returns a deep copy of this RelatedTermModule.
|
static RelatedTermModule |
readFrom(java.io.InputStream is)
Read this RelatedTermModule from an XML fragment.
|
void |
setKeepLongestMatch(boolean keepLongestMatch)
Keeps only the longest match.
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'. |
void |
setMaxSpan(int maxSpan)
Maximal number of words (excluding stop words) in a generated related term.
|
void |
setMinSpan(int minSpan)
Minimum number of words (excluding stop words) in a generated related term.
|
void |
setWithPartOfSpeech(boolean withPartOfSpeech)
Automatically adds a PartOfSpeechTagger to the list of processors.
|
java.lang.String |
toString()
String representation of this RelatedTermModule.
|
RelatedTermModule |
withKeepLongestMatch(boolean keepLongestMatch) |
RelatedTermModule |
withKeepLongestMatch(java.lang.Boolean keepLongestMatch) |
RelatedTermModule |
withMaxSpan(int maxSpan) |
RelatedTermModule |
withMaxSpan(java.lang.Integer maxSpan) |
RelatedTermModule |
withMinSpan(int minSpan) |
RelatedTermModule |
withMinSpan(java.lang.Integer minSpan) |
RelatedTermModule |
withName(java.lang.String name) |
RelatedTermModule |
withWithPartOfSpeech(boolean withPartOfSpeech) |
RelatedTermModule |
withWithPartOfSpeech(java.lang.Boolean withPartOfSpeech) |
void |
writeTo(java.io.OutputStream os)
Write this RelatedTermModule as an XML fragment
|
getName, setName
public int minSpan
public static final int DEFAULT_MIN_SPAN
public int maxSpan
public static final int DEFAULT_MAX_SPAN
public boolean keepLongestMatch
public static final boolean DEFAULT_KEEP_LONGEST_MATCH
public boolean withPartOfSpeech
public static final boolean DEFAULT_WITH_PART_OF_SPEECH
public RelatedTermModule()
public RelatedTermModule(RelatedTermModule o)
public RelatedTermModule withName(java.lang.String name)
withName
in class QueryExpansionModule
public void setMinSpan(int minSpan)
public int getMinSpan()
public RelatedTermModule withMinSpan(int minSpan)
public RelatedTermModule withMinSpan(java.lang.Integer minSpan)
public void setMaxSpan(int maxSpan)
public int getMaxSpan()
public RelatedTermModule withMaxSpan(int maxSpan)
public RelatedTermModule withMaxSpan(java.lang.Integer maxSpan)
public void setKeepLongestMatch(boolean keepLongestMatch)
public boolean isKeepLongestMatch()
public RelatedTermModule withKeepLongestMatch(boolean keepLongestMatch)
public RelatedTermModule withKeepLongestMatch(java.lang.Boolean keepLongestMatch)
public void setWithPartOfSpeech(boolean withPartOfSpeech)
public boolean isWithPartOfSpeech()
public RelatedTermModule withWithPartOfSpeech(boolean withPartOfSpeech)
public RelatedTermModule withWithPartOfSpeech(java.lang.Boolean withPartOfSpeech)
public RelatedTermModule makeCopy()
makeCopy
in class QueryExpansionModule
public static RelatedTermModule 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 QueryExpansionModule
javax.xml.bind.JAXBException
java.io.IOException
public static RelatedTermModule 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 QueryExpansionModule
public void check(boolean deep, java.lang.String errorContext) throws com.exalead.util.TypedException
check
in interface com.exalead.util.Checkable
check
in class QueryExpansionModule
com.exalead.util.TypedException
public void accept(QueryExpansionModule.Visitor visitor) throws com.exalead.util.TypedException
accept
in class QueryExpansionModule
com.exalead.util.TypedException
public <T> T accept(QueryExpansionModule.Transformer<T> transformer, T[] t) throws com.exalead.util.TypedException
accept
in class QueryExpansionModule
com.exalead.util.TypedException
Copyright © 2021 Dassault Systèmes, All Rights Reserved.