public class NGramModule extends QueryExpansionModule implements com.exalead.util.Checkable, java.io.Serializable
/>
,
Serialized FormQueryExpansionModule.Transformer<T>, QueryExpansionModule.Visitor
Modifier and Type | Field and Description |
---|---|
boolean |
addCanonicalForm |
static boolean |
DEFAULT_ADD_CANONICAL_FORM |
static boolean |
DEFAULT_KEEP_LONGEST_MATCH |
static int |
DEFAULT_MAX_SPAN |
static int |
DEFAULT_MIN_SPAN |
static boolean |
DEFAULT_WITH_LEMMATIZER |
static boolean |
DEFAULT_WITH_STOP_WORD_DICT |
boolean |
keepLongestMatch |
int |
maxSpan |
int |
minSpan |
boolean |
withLemmatizer |
boolean |
withStopWordDict |
name
Constructor and Description |
---|
NGramModule() |
NGramModule(NGramModule 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 NGramModule.
|
static NGramModule |
fromString(java.lang.String s)
String representation of this NGramModule.
|
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 |
isAddCanonicalForm() |
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'. This option will only keep 'b-c-d' and will remove all other related terms. |
boolean |
isWithLemmatizer()
Adds a Lemmatizer to the list of processors automatically.
|
boolean |
isWithStopWordDict()
Adds a StopWord dictionary to the list of processors automatically.
|
NGramModule |
makeCopy()
Creates and returns a deep copy of this NGramModule.
|
static NGramModule |
readFrom(java.io.InputStream is)
Read this NGramModule from an XML fragment.
|
void |
setAddCanonicalForm(boolean addCanonicalForm) |
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'. This option will only keep 'b-c-d' and will remove all other related terms. |
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 |
setWithLemmatizer(boolean withLemmatizer)
Adds a Lemmatizer to the list of processors automatically.
|
void |
setWithStopWordDict(boolean withStopWordDict)
Adds a StopWord dictionary to the list of processors automatically.
|
java.lang.String |
toString()
String representation of this NGramModule.
|
NGramModule |
withAddCanonicalForm(boolean addCanonicalForm) |
NGramModule |
withAddCanonicalForm(java.lang.Boolean addCanonicalForm) |
NGramModule |
withKeepLongestMatch(boolean keepLongestMatch) |
NGramModule |
withKeepLongestMatch(java.lang.Boolean keepLongestMatch) |
NGramModule |
withMaxSpan(int maxSpan) |
NGramModule |
withMaxSpan(java.lang.Integer maxSpan) |
NGramModule |
withMinSpan(int minSpan) |
NGramModule |
withMinSpan(java.lang.Integer minSpan) |
NGramModule |
withName(java.lang.String name) |
NGramModule |
withWithLemmatizer(boolean withLemmatizer) |
NGramModule |
withWithLemmatizer(java.lang.Boolean withLemmatizer) |
NGramModule |
withWithStopWordDict(boolean withStopWordDict) |
NGramModule |
withWithStopWordDict(java.lang.Boolean withStopWordDict) |
void |
writeTo(java.io.OutputStream os)
Write this NGramModule 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 withLemmatizer
public static final boolean DEFAULT_WITH_LEMMATIZER
public boolean withStopWordDict
public static final boolean DEFAULT_WITH_STOP_WORD_DICT
public boolean addCanonicalForm
public static final boolean DEFAULT_ADD_CANONICAL_FORM
public NGramModule()
public NGramModule(NGramModule o)
public NGramModule withName(java.lang.String name)
withName
in class QueryExpansionModule
public void setMinSpan(int minSpan)
public int getMinSpan()
public NGramModule withMinSpan(int minSpan)
public NGramModule withMinSpan(java.lang.Integer minSpan)
public void setMaxSpan(int maxSpan)
public int getMaxSpan()
public NGramModule withMaxSpan(int maxSpan)
public NGramModule withMaxSpan(java.lang.Integer maxSpan)
public void setKeepLongestMatch(boolean keepLongestMatch)
public boolean isKeepLongestMatch()
public NGramModule withKeepLongestMatch(boolean keepLongestMatch)
public NGramModule withKeepLongestMatch(java.lang.Boolean keepLongestMatch)
public void setWithLemmatizer(boolean withLemmatizer)
public boolean isWithLemmatizer()
public NGramModule withWithLemmatizer(boolean withLemmatizer)
public NGramModule withWithLemmatizer(java.lang.Boolean withLemmatizer)
public void setWithStopWordDict(boolean withStopWordDict)
public boolean isWithStopWordDict()
public NGramModule withWithStopWordDict(boolean withStopWordDict)
public NGramModule withWithStopWordDict(java.lang.Boolean withStopWordDict)
public void setAddCanonicalForm(boolean addCanonicalForm)
public boolean isAddCanonicalForm()
public NGramModule withAddCanonicalForm(boolean addCanonicalForm)
public NGramModule withAddCanonicalForm(java.lang.Boolean addCanonicalForm)
public NGramModule makeCopy()
makeCopy
in class QueryExpansionModule
public static NGramModule 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 NGramModule 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.