public class LinguisticExpanderResource
extends java.lang.Object
The resource contains:
The resource is meant to be configured through calls to
#setTokenizers
, #setNormalizer
and addProcessor(java.lang.String, com.exalead.search.query.linguistic.LinguisticExpanderResource.Handler)
.
It must then be initialized though init(java.util.List<com.exalead.linguistic.v10.Tokenizer>, com.exalead.linguistic.v10.NormalizerConfig)
.
The resource can
then be used to retrieve SemanticProcessor and LinguisticPostProcessor.
Modifier and Type | Class and Description |
---|---|
static interface |
LinguisticExpanderResource.Handler
A Handler is a factory for:
a set of SemanticProcessor to annotate the TokenizedNode a
factory of PostProcessor
|
static class |
LinguisticExpanderResource.PostProcessorFactory
Abstract factory that creates a LinguisticPostProcessor.
|
Constructor and Description |
---|
LinguisticExpanderResource()
Build a non-configured, non-initialized resource.
|
Modifier and Type | Method and Description |
---|---|
JaZhDisambiguisator |
acquireJaZhDisambiguisator()
Acquire a standalone JaZhDisambiguisator
|
Normalizer |
acquireNormalizer(java.lang.String tokenizationConfig)
Acquire a standalone normalizer
|
MOTPipe |
acquireRTMOTPipe(java.lang.String tokenizationConfig)
Get a MOT pipe from the resource.
The pipe returned must be released with releaseRTMOTPipe(java.lang.String, com.exalead.mot.core.MOTPipe) in order to be recycled properly. |
MOTPipe |
acquireUnitsOfMeasurementMOTPipe()
Get a MOT pipe from the resource.
The pipe returned must be released with releaseUnitsOfMeasurementMOTPipe(com.exalead.mot.core.MOTPipe) in order to be recycled properly. |
void |
addProcessor(java.lang.String name,
LinguisticExpanderResource.Handler handler)
Add a linguistic processor to this expander, using the Handler factory
class.
|
void |
addProcessor(java.lang.String name,
java.util.List<SemanticProcessor> semanticProcessor,
LinguisticExpanderResource.PostProcessorFactory postProcFact)
Add a linguistic processor to this expander, defined by its semantic
processor and post processor factory.
|
void |
addTokenizationConfig(TokenizationConfig config) |
LinguisticExpander |
buildExpander(com.exalead.flis.FLISServiceClient client,
UQLConfig config)
Factory method
|
int |
getTrustLevel(java.lang.String tokenizationConfigName,
java.lang.String tag,
int defaultValue) |
void |
init()
Deprecated.
|
void |
init(java.util.List<Tokenizer> tokenizers,
NormalizerConfig nConfig)
Deprecated.
|
void |
init(java.lang.String defaultTokenizationConfig)
Initialize the resource.
A resource cannot be used before being initialized. |
void |
release()
Release MOT resources
|
void |
releaseJaZhDisambiguisator(JaZhDisambiguisator jaZh)
Release a standalone JaZhDisambiguisator acquired via acquireJaZhDisambiguisator
|
void |
releaseNormalizer(java.lang.String tokenizationConfig,
Normalizer n)
Release a standalone normalizer acquired via acquireNormalizer
|
void |
releaseRTMOTPipe(java.lang.String tokenizationConfig,
MOTPipe pipe)
Release a MOT pipe to the resource.
|
void |
releaseUnitsOfMeasurementMOTPipe(MOTPipe pipe)
Release a MOT pipe to the resource.
|
public LinguisticExpanderResource()
public void addTokenizationConfig(TokenizationConfig config)
public int getTrustLevel(java.lang.String tokenizationConfigName, java.lang.String tag, int defaultValue)
public void addProcessor(java.lang.String name, LinguisticExpanderResource.Handler handler)
name
- This name is only used for tracing and debugging purposes.handler
- The factory building the linguistic processors.LinguisticExpanderResource.Handler
public void addProcessor(java.lang.String name, java.util.List<SemanticProcessor> semanticProcessor, LinguisticExpanderResource.PostProcessorFactory postProcFact)
@Deprecated public void init(java.util.List<Tokenizer> tokenizers, NormalizerConfig nConfig)
@Deprecated public void init()
public void init(java.lang.String defaultTokenizationConfig)
public void release()
public LinguisticExpander buildExpander(com.exalead.flis.FLISServiceClient client, UQLConfig config)
public MOTPipe acquireRTMOTPipe(java.lang.String tokenizationConfig) throws QueryProcessingException
releaseRTMOTPipe(java.lang.String, com.exalead.mot.core.MOTPipe)
in order to be recycled properly. Used by
the KeywordPrefix.QueryProcessingException
public MOTPipe acquireUnitsOfMeasurementMOTPipe() throws QueryProcessingException
releaseUnitsOfMeasurementMOTPipe(com.exalead.mot.core.MOTPipe)
in order to be recycled properly. Used by
the UnitsOfMeasurementPrefix.QueryProcessingException
public Normalizer acquireNormalizer(java.lang.String tokenizationConfig)
public void releaseNormalizer(java.lang.String tokenizationConfig, Normalizer n)
public JaZhDisambiguisator acquireJaZhDisambiguisator()
public void releaseJaZhDisambiguisator(JaZhDisambiguisator jaZh)
public void releaseRTMOTPipe(java.lang.String tokenizationConfig, MOTPipe pipe)
pipe
- A used MOT pipe obtained through acquireRTMOTPipe(java.lang.String)
public void releaseUnitsOfMeasurementMOTPipe(MOTPipe pipe)
pipe
- A used MOT pipe obtained through acquireUnitsOfMeasurementMOTPipe()
Copyright © 2013 Dassault Systèmes, All Rights Reserved.