@Service
@Properties(value={@Property(name="stanbol.enhancer.engine.name",value="pos-chunker"),@Property(name="enhancer.engine.poschunker.languages",cardinality=2147483647,value="*"),@Property(name="enhancer.engine.poschunker.minPosScore",doubleValue=0.5),@Property(name="enhancer.engine.poschunker.nounPhrase",boolValue=true),@Property(name="enhancer.engine.poschunker.verbPhrase",boolValue=false),@Property(name="service.ranking",intValue=-100)})
public class PosChunkerEngine
extends org.apache.stanbol.enhancer.servicesapi.impl.AbstractEnhancementEngine<RuntimeException,RuntimeException>
implements org.apache.stanbol.enhancer.servicesapi.ServiceProperties
org.apache.stanbol.enhancer.engines.opennlp.pos.model.POSContentPart to
be present in the content item and will extend each org.apache.stanbol.enhancer.engines.opennlp.pos.model.POSSentence
with an array of chunks.| Modifier and Type | Field and Description |
|---|---|
static String |
CONFIG_LANGUAGES
Language configuration.
|
static double |
DEFAULT_MIN_POS_SCORE |
static boolean |
DEFAULT_NOUN_PHRASE_STATE |
static boolean |
DEFAULT_VERB_PHRASE_STATE |
static String |
MIN_POS_SCORE |
static String |
NOUN_PHRASE_STATE |
static String |
VERB_PHRASE_STATE |
ENHANCEMENT_ENGINE_ORDERING, ORDERING_CONTENT_EXTRACTION, ORDERING_DEFAULT, ORDERING_EXTRACTION_ENHANCEMENT, ORDERING_NLP_CHUNK, ORDERING_NLP_LANGAUGE_DETECTION, ORDERING_NLP_LEMMATIZE, ORDERING_NLP_POS, ORDERING_NLP_SENTENCE_DETECTION, ORDERING_NLP_TOKENIZING, ORDERING_POST_PROCESSING, ORDERING_PRE_PROCESSING| Constructor and Description |
|---|
PosChunkerEngine() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate(org.osgi.service.component.ComponentContext ce)
Activate and read the properties.
|
int |
canEnhance(org.apache.stanbol.enhancer.servicesapi.ContentItem ci)
Indicate if this engine can enhance supplied ContentItem, and if it
suggests enhancing it synchronously or asynchronously.
|
void |
computeEnhancements(org.apache.stanbol.enhancer.servicesapi.ContentItem ci)
Compute enhancements for supplied ContentItem.
|
protected void |
deactivate(org.osgi.service.component.ComponentContext context) |
Map<String,Object> |
getServiceProperties() |
public static final String CONFIG_LANGUAGES
public static final String MIN_POS_SCORE
public static final double DEFAULT_MIN_POS_SCORE
public static final String NOUN_PHRASE_STATE
public static final boolean DEFAULT_NOUN_PHRASE_STATE
public static final String VERB_PHRASE_STATE
public static final boolean DEFAULT_VERB_PHRASE_STATE
public int canEnhance(org.apache.stanbol.enhancer.servicesapi.ContentItem ci)
throws org.apache.stanbol.enhancer.servicesapi.EngineException
EnhancementJobManager can force sync/async mode if desired, it is
just a suggestion from the engine.
Returns CANNOT_ENHANCE if the content item does not have a POSContentPart, the language of the content is not
available or no chunker for the language is available.canEnhance in interface org.apache.stanbol.enhancer.servicesapi.EnhancementEngineorg.apache.stanbol.enhancer.servicesapi.EngineException - if the introspecting process of the content item
failspublic void computeEnhancements(org.apache.stanbol.enhancer.servicesapi.ContentItem ci)
throws org.apache.stanbol.enhancer.servicesapi.EngineException
EnhancementJobManager) should take care of
persistent storage of the enhanced ContentItem.computeEnhancements in interface org.apache.stanbol.enhancer.servicesapi.EnhancementEngineorg.apache.stanbol.enhancer.servicesapi.EngineException - if the underlying process failed to work as
expectedpublic Map<String,Object> getServiceProperties()
getServiceProperties in interface org.apache.stanbol.enhancer.servicesapi.ServiceProperties@Activate
protected void activate(org.osgi.service.component.ComponentContext ce)
throws org.osgi.service.cm.ConfigurationException
activate in class org.apache.stanbol.enhancer.servicesapi.impl.AbstractEnhancementEngine<RuntimeException,RuntimeException>ce - the ComponentContextorg.osgi.service.cm.ConfigurationException@Deactivate protected void deactivate(org.osgi.service.component.ComponentContext context)
deactivate in class org.apache.stanbol.enhancer.servicesapi.impl.AbstractEnhancementEngine<RuntimeException,RuntimeException>Copyright © 2014 The Apache Software Foundation. All Rights Reserved.