public class QueryExpansionConfig
extends java.lang.Object
implements com.exalead.util.Checkable, java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
QueryExpansionConfig.UnavailableDictionaryAction |
static class |
QueryExpansionConfig.UnavailableDictionaryReportMode |
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_DETECT_C_J |
static java.lang.String |
DEFAULT_EXACT_PHRASE_EXPANSION_MODULES_BLACK_LIST |
static boolean |
DEFAULT_LANG_DETECT |
static double |
DEFAULT_LANG_DETECT_THRESHOLD |
static int |
DEFAULT_LONG_FORMS_PRUNING_THRESHOLD |
static boolean |
DEFAULT_PERFORM_EXACT_PHRASE_EXPANSION |
static int |
DEFAULT_TIMEOUT_M_S |
static java.lang.String |
DEFAULT_UNAVAILABLE_DICTIONARY_ACTION |
static java.lang.String |
DEFAULT_UNAVAILABLE_DICTIONARY_REPORT_MODE |
boolean |
detectCJ |
java.lang.String |
exactPhraseExpansionModulesBlackList |
boolean |
langDetect |
LangDetectMapping |
langDetectMapping |
double |
langDetectThreshold |
int |
longFormsPruningThreshold |
boolean |
performExactPhraseExpansion |
int |
timeoutMS |
java.lang.String |
unavailableDictionaryAction |
java.lang.String |
unavailableDictionaryReportMode |
Constructor and Description |
---|
QueryExpansionConfig() |
QueryExpansionConfig(QueryExpansionConfig o)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
void |
check(boolean deep,
java.lang.String errorContext)
Checks this QueryExpansionConfig.
|
static QueryExpansionConfig |
fromString(java.lang.String s)
String representation of this QueryExpansionConfig.
|
java.lang.String |
getExactPhraseExpansionModulesBlackList()
If performExactPhraseExpansion is true, this list of comma-separated query expansion module names defines which modules are disabled when expanding exact phrases.
|
LangDetectMapping |
getLangDetectMapping() |
double |
getLangDetectThreshold()
If langDetect is True, it tries to detect the text language.
|
int |
getLongFormsPruningThreshold()
Prunes forms spanning several shorter forms from query nodes larger than N tokens, to avoid combination.
|
int |
getTimeoutMS() |
java.lang.String |
getUnavailableDictionaryAction()
Action to execute if the dictionary cannot be contacted for expansion.
|
QueryExpansionConfig.UnavailableDictionaryAction |
getUnavailableDictionaryActionAsEnum()
Action to execute if the dictionary cannot be contacted for expansion.
|
java.lang.String |
getUnavailableDictionaryReportMode()
Value can be null or one of
quiet
global
local
|
QueryExpansionConfig.UnavailableDictionaryReportMode |
getUnavailableDictionaryReportModeAsEnum()
Value can be null or one of
quiet
global
local
|
static boolean |
isA(java.lang.String str,
QueryExpansionConfig.UnavailableDictionaryAction item) |
static boolean |
isA(java.lang.String str,
QueryExpansionConfig.UnavailableDictionaryReportMode item) |
boolean |
isDetectCJ()
Tries to detect Chinese and Japanese in the query and override the language of the request accordingly.
If false, it uses the user-specified language for expansion. |
boolean |
isLangDetect()
Tries to detect the text language from its unicode range.
If false, it uses the user-specified language for expansion (xx is the default one). |
static boolean |
isOneOf(java.lang.String str,
QueryExpansionConfig.UnavailableDictionaryAction... items) |
static boolean |
isOneOf(java.lang.String str,
QueryExpansionConfig.UnavailableDictionaryReportMode... items) |
boolean |
isPerformExactPhraseExpansion()
Activates query expansion on expressions contained within quotation marks.
In this case, a number of query expansion modules can be disabled by exactPhraseExpansionModulesBlackList. |
QueryExpansionConfig |
makeCopy()
Creates and returns a deep copy of this QueryExpansionConfig.
|
static QueryExpansionConfig |
readFrom(java.io.InputStream is)
Read this QueryExpansionConfig from an XML fragment.
|
void |
setDetectCJ(boolean detectCJ)
Tries to detect Chinese and Japanese in the query and override the language of the request accordingly.
If false, it uses the user-specified language for expansion. |
void |
setExactPhraseExpansionModulesBlackList(java.lang.String exactPhraseExpansionModulesBlackList)
If performExactPhraseExpansion is true, this list of comma-separated query expansion module names defines which modules are disabled when expanding exact phrases.
|
void |
setLangDetect(boolean langDetect)
Tries to detect the text language from its unicode range.
If false, it uses the user-specified language for expansion (xx is the default one). |
void |
setLangDetectMapping(LangDetectMapping langDetectMapping) |
void |
setLangDetectThreshold(double langDetectThreshold)
If langDetect is True, it tries to detect the text language.
|
void |
setLongFormsPruningThreshold(int longFormsPruningThreshold)
Prunes forms spanning several shorter forms from query nodes larger than N tokens, to avoid combination.
|
void |
setPerformExactPhraseExpansion(boolean performExactPhraseExpansion)
Activates query expansion on expressions contained within quotation marks.
In this case, a number of query expansion modules can be disabled by exactPhraseExpansionModulesBlackList. |
void |
setTimeoutMS(int timeoutMS) |
void |
setUnavailableDictionaryAction(QueryExpansionConfig.UnavailableDictionaryAction item)
Action to execute if the dictionary cannot be contacted for expansion.
|
void |
setUnavailableDictionaryAction(java.lang.String unavailableDictionaryAction)
Action to execute if the dictionary cannot be contacted for expansion.
|
void |
setUnavailableDictionaryReportMode(QueryExpansionConfig.UnavailableDictionaryReportMode item)
Value can be null or one of
quiet
global
local
|
void |
setUnavailableDictionaryReportMode(java.lang.String unavailableDictionaryReportMode)
Value can be null or one of
quiet
global
local
|
java.lang.String |
toString()
String representation of this QueryExpansionConfig.
|
QueryExpansionConfig |
withDetectCJ(boolean detectCJ) |
QueryExpansionConfig |
withDetectCJ(java.lang.Boolean detectCJ) |
QueryExpansionConfig |
withExactPhraseExpansionModulesBlackList(java.lang.String exactPhraseExpansionModulesBlackList) |
QueryExpansionConfig |
withLangDetect(boolean langDetect) |
QueryExpansionConfig |
withLangDetect(java.lang.Boolean langDetect) |
QueryExpansionConfig |
withLangDetectMapping(LangDetectMapping langDetectMapping) |
QueryExpansionConfig |
withLangDetectThreshold(double langDetectThreshold) |
QueryExpansionConfig |
withLongFormsPruningThreshold(int longFormsPruningThreshold) |
QueryExpansionConfig |
withLongFormsPruningThreshold(java.lang.Integer longFormsPruningThreshold) |
QueryExpansionConfig |
withPerformExactPhraseExpansion(boolean performExactPhraseExpansion) |
QueryExpansionConfig |
withPerformExactPhraseExpansion(java.lang.Boolean performExactPhraseExpansion) |
QueryExpansionConfig |
withTimeoutMS(int timeoutMS) |
QueryExpansionConfig |
withTimeoutMS(java.lang.Integer timeoutMS) |
QueryExpansionConfig |
withUnavailableDictionaryAction(java.lang.String unavailableDictionaryAction) |
QueryExpansionConfig |
withUnavailableDictionaryReportMode(java.lang.String unavailableDictionaryReportMode) |
void |
writeTo(java.io.OutputStream os)
Write this QueryExpansionConfig as an XML fragment
|
public int timeoutMS
public static final int DEFAULT_TIMEOUT_M_S
public java.lang.String unavailableDictionaryAction
public static final java.lang.String DEFAULT_UNAVAILABLE_DICTIONARY_ACTION
public java.lang.String unavailableDictionaryReportMode
public static final java.lang.String DEFAULT_UNAVAILABLE_DICTIONARY_REPORT_MODE
public boolean detectCJ
public static final boolean DEFAULT_DETECT_C_J
public boolean langDetect
public static final boolean DEFAULT_LANG_DETECT
public double langDetectThreshold
public static final double DEFAULT_LANG_DETECT_THRESHOLD
public LangDetectMapping langDetectMapping
public int longFormsPruningThreshold
public static final int DEFAULT_LONG_FORMS_PRUNING_THRESHOLD
public boolean performExactPhraseExpansion
public static final boolean DEFAULT_PERFORM_EXACT_PHRASE_EXPANSION
public java.lang.String exactPhraseExpansionModulesBlackList
public static final java.lang.String DEFAULT_EXACT_PHRASE_EXPANSION_MODULES_BLACK_LIST
public QueryExpansionConfig()
public QueryExpansionConfig(QueryExpansionConfig o)
public static boolean isA(java.lang.String str, QueryExpansionConfig.UnavailableDictionaryAction item)
public static boolean isOneOf(java.lang.String str, QueryExpansionConfig.UnavailableDictionaryAction... items)
public void setUnavailableDictionaryAction(QueryExpansionConfig.UnavailableDictionaryAction item)
public QueryExpansionConfig.UnavailableDictionaryAction getUnavailableDictionaryActionAsEnum()
public static boolean isA(java.lang.String str, QueryExpansionConfig.UnavailableDictionaryReportMode item)
public static boolean isOneOf(java.lang.String str, QueryExpansionConfig.UnavailableDictionaryReportMode... items)
public void setUnavailableDictionaryReportMode(QueryExpansionConfig.UnavailableDictionaryReportMode item)
public QueryExpansionConfig.UnavailableDictionaryReportMode getUnavailableDictionaryReportModeAsEnum()
public void setTimeoutMS(int timeoutMS)
public int getTimeoutMS()
public QueryExpansionConfig withTimeoutMS(int timeoutMS)
public QueryExpansionConfig withTimeoutMS(java.lang.Integer timeoutMS)
public void setUnavailableDictionaryAction(java.lang.String unavailableDictionaryAction)
public java.lang.String getUnavailableDictionaryAction()
public QueryExpansionConfig withUnavailableDictionaryAction(java.lang.String unavailableDictionaryAction)
public void setUnavailableDictionaryReportMode(java.lang.String unavailableDictionaryReportMode)
public java.lang.String getUnavailableDictionaryReportMode()
public QueryExpansionConfig withUnavailableDictionaryReportMode(java.lang.String unavailableDictionaryReportMode)
public void setDetectCJ(boolean detectCJ)
public boolean isDetectCJ()
public QueryExpansionConfig withDetectCJ(boolean detectCJ)
public QueryExpansionConfig withDetectCJ(java.lang.Boolean detectCJ)
public void setLangDetect(boolean langDetect)
public boolean isLangDetect()
public QueryExpansionConfig withLangDetect(boolean langDetect)
public QueryExpansionConfig withLangDetect(java.lang.Boolean langDetect)
public void setLangDetectThreshold(double langDetectThreshold)
public double getLangDetectThreshold()
public QueryExpansionConfig withLangDetectThreshold(double langDetectThreshold)
public void setLangDetectMapping(LangDetectMapping langDetectMapping)
public LangDetectMapping getLangDetectMapping()
public QueryExpansionConfig withLangDetectMapping(LangDetectMapping langDetectMapping)
public void setLongFormsPruningThreshold(int longFormsPruningThreshold)
public int getLongFormsPruningThreshold()
public QueryExpansionConfig withLongFormsPruningThreshold(int longFormsPruningThreshold)
public QueryExpansionConfig withLongFormsPruningThreshold(java.lang.Integer longFormsPruningThreshold)
public void setPerformExactPhraseExpansion(boolean performExactPhraseExpansion)
public boolean isPerformExactPhraseExpansion()
public QueryExpansionConfig withPerformExactPhraseExpansion(boolean performExactPhraseExpansion)
public QueryExpansionConfig withPerformExactPhraseExpansion(java.lang.Boolean performExactPhraseExpansion)
public void setExactPhraseExpansionModulesBlackList(java.lang.String exactPhraseExpansionModulesBlackList)
public java.lang.String getExactPhraseExpansionModulesBlackList()
public QueryExpansionConfig withExactPhraseExpansionModulesBlackList(java.lang.String exactPhraseExpansionModulesBlackList)
public QueryExpansionConfig makeCopy()
public static QueryExpansionConfig 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
javax.xml.bind.JAXBException
java.io.IOException
public static QueryExpansionConfig 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 java.lang.Object
public void check(boolean deep, java.lang.String errorContext) throws com.exalead.util.TypedException
check
in interface com.exalead.util.Checkable
com.exalead.util.TypedException
Copyright © 2013 Dassault Systèmes, All Rights Reserved.