public class CompositeExtractor extends EntityExtractor implements EntityVerifier
Constructor and Description |
---|
CompositeExtractor() |
Modifier and Type | Method and Description |
---|---|
void |
addExtractor(EntityExtractor extractor)
Add an extractor to the set of entity extractors used by this composite
extractor.
|
void |
addExtractor(EntityExtractor extractor,
int weight)
Add an extractor to the set of entity extractors used by this composite
extractor, along with a weight.
|
void |
addVerifier(EntityVerifier verifier)
Add an entity verifier to the set of entity verifiers used by this
composite extractor.
|
void |
addVerifier(EntityVerifier verifier,
int weight)
Add an entity verifier to the set of entity verifiers used by this
composite extractor, using the specified weight
|
EntityType |
determineType(java.lang.String term)
Determine the entity type for a particular term.
|
protected void |
extractEntities(java.lang.String text,
java.util.Map<java.lang.String,EntityTag> tokenMap)
Extract the entities from the text provided.
|
java.util.Map<java.lang.String,java.lang.String> |
extractEntityRawTypes(java.lang.String text)
Retrieve the entities and the raw types for this entity extractor.
|
java.util.Set<EntityExtractor> |
getExtractors()
Get the set of extractors used by this composite extractor
|
java.util.Set<EntityType> |
getSupportedTypes()
Return the list of types this verifier can verify.
|
java.util.Set<EntityVerifier> |
getVerifiers()
Get the set of verifiers used by this composite extractor
|
java.lang.String |
normalize(java.lang.String term,
EntityType type)
Get a normalized form for this entity and type.
|
void |
setDocumentDate(java.util.Date date)
Set the date to be used for documents.
|
boolean |
verifyType(java.lang.String term,
EntityType type)
Verify that the term matches the type.
|
addTagFieldMapping, addTextField, augmentRecord, extract, extract, extract, extract, getDefaultTagField, getModel, isDebug, setDebug, setDefaultTagField, setModel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getModel, setModel
public void addExtractor(EntityExtractor extractor)
extractor
- the new entity extractorpublic void addExtractor(EntityExtractor extractor, int weight)
extractor
- the new entity extractorweight
- the weight for the extractorpublic void addVerifier(EntityVerifier verifier)
verifier
- the new entity verifierpublic void addVerifier(EntityVerifier verifier, int weight)
verifier
- the new entity verifierweight
- the weight for the verifierpublic EntityType determineType(java.lang.String term)
determineType
in interface EntityVerifier
term
- the term to check. This is the extracted entityprotected void extractEntities(java.lang.String text, java.util.Map<java.lang.String,EntityTag> tokenMap)
extractEntityRawTypes()
, then uses an internal map to map
the raw entity types to EntityType objects.extractEntities
in class EntityExtractor
text
- the text to extracttokenMap
- the map to contain the tokens in.public java.util.Map<java.lang.String,java.lang.String> extractEntityRawTypes(java.lang.String text)
extractEntityRawTypes
in class EntityExtractor
text
- the text to parse for entitiespublic java.util.Set<EntityExtractor> getExtractors()
public java.util.Set<EntityType> getSupportedTypes()
getSupportedTypes
in interface EntityVerifier
public java.util.Set<EntityVerifier> getVerifiers()
public java.lang.String normalize(java.lang.String term, EntityType type)
normalize
in interface EntityVerifier
term
- the term to normalizetype
- the entity typepublic void setDocumentDate(java.util.Date date)
date
- the date for the document to be parsedpublic boolean verifyType(java.lang.String term, EntityType type)
verifyType
in interface EntityVerifier
term
- the term to check. This is the extracted entitytype
- the type to check against.