|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.raritantechnologies.concept.classifier.BasicDocumentMatcher
com.raritantechnologies.concept.classifier.FieldValueMatcher
Used for fielded document matching - determines if a match occurs with a specific metadata field in a document.
XML Configuration Template:
<DocumentMatcher class="com.raritantechnologies.concept.classifier.FieldValueMatcher"
fieldName="[ name of document field ]" >
<!-- the Matcher to use to determine if a match has occured in the specied field -->
<DocumentMatcher class="[ class of com.raritantechnologies.concept.classifier.IDocumentMatcher ]" >
</DocumentMatcher>
<!-- Alternatively, can use an IComparator to determine if the field value matches -->
<!-- Used for numerical comparisons such as min, max, range -->
<Comparator class="[ class of com.raritantechnologies.utils.comparators.IComparator ]" >
</Comparator>
</DocumentMatcher>
| Constructor Summary | |
FieldValueMatcher()
|
|
FieldValueMatcher(java.lang.String fieldName,
IComparator fieldComparator)
|
|
FieldValueMatcher(java.lang.String fieldName,
IDocumentMatcher proxyMatcher)
|
|
| Method Summary | |
protected void |
collectPhraseSet(java.util.HashSet phraseSet)
|
protected void |
collectTermSet(java.util.HashSet termSet)
|
void |
extractTerms(IndexedDocument fromDocument,
java.util.HashMap termsMap)
Extracts the matching terms contained in the document. |
void |
extractTerms(IndexedDocument fromDocument,
java.util.Set termsSet)
|
java.util.Map |
extractTerms(java.lang.String sessionID,
java.lang.String fromString)
returns a map of terms - key is the term, value is either an AttributeWordsTagger or an Attribute string |
DocumentMatchBean |
getMatchCriteria(IndexedDocument document,
java.util.Map termsMap)
returns a DocumentMatchBean containing the match criteria (the category or categories that specify the 'reason' or context of the match. |
java.lang.String |
getName()
|
java.util.Set |
getPhraseSet()
returns the list of phrases in all contained PhraseDocumentMatchers |
java.util.Set |
getTermSet()
returns the list of terms in all contained TermDocumentMatchers |
void |
initialize(org.w3c.dom.Element elem)
Initializes the object from an XML tag or element. |
boolean |
isStopWord(IndexedDocument document)
Adds stop word support. |
boolean |
matches(IndexedDocument document)
returns true if the matcher matches the IndexedDocument, false otherwise. |
java.lang.String |
render()
Renders a human-readable version of the matcher's logic. |
void |
setName(java.lang.String name)
Unique key that identifies this IDocumentMatcher |
| Methods inherited from class com.raritantechnologies.concept.classifier.BasicDocumentMatcher |
addAttribute, addTerms, addTermsAsAttributes, getAttribute, getAttributeNames, getMatchCriteria |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.raritantechnologies.concept.classifier.IDocumentMatcher |
addAttribute, addTermsAsAttributes, getAttribute, getAttributeNames, getMatchCriteria |
| Constructor Detail |
public FieldValueMatcher()
public FieldValueMatcher(java.lang.String fieldName,
IDocumentMatcher proxyMatcher)
public FieldValueMatcher(java.lang.String fieldName,
IComparator fieldComparator)
| Method Detail |
public void setName(java.lang.String name)
IDocumentMatcher
setName in interface IDocumentMatchersetName in class BasicDocumentMatcherpublic java.lang.String getName()
getName in interface IDocumentMatchergetName in class BasicDocumentMatcherpublic boolean matches(IndexedDocument document)
IDocumentMatcher
matches in interface IDocumentMatchermatches in class BasicDocumentMatcher
public DocumentMatchBean getMatchCriteria(IndexedDocument document,
java.util.Map termsMap)
IDocumentMatcher
getMatchCriteria in interface IDocumentMatchergetMatchCriteria in class BasicDocumentMatcherpublic boolean isStopWord(IndexedDocument document)
IDocumentMatcherTermDocumentMatcher.
isStopWord in interface IDocumentMatcherisStopWord in class BasicDocumentMatcherprotected void collectTermSet(java.util.HashSet termSet)
collectTermSet in class BasicDocumentMatcherprotected void collectPhraseSet(java.util.HashSet phraseSet)
collectPhraseSet in class BasicDocumentMatcherpublic java.util.Set getTermSet()
IDocumentMatcher
getTermSet in interface IDocumentMatchergetTermSet in class BasicDocumentMatcherpublic java.util.Set getPhraseSet()
IDocumentMatcher
getPhraseSet in interface IDocumentMatchergetPhraseSet in class BasicDocumentMatcher
public void extractTerms(IndexedDocument fromDocument,
java.util.HashMap termsMap)
IDocumentMatcher
extractTerms in interface IDocumentMatcherextractTerms in class BasicDocumentMatcher
public void extractTerms(IndexedDocument fromDocument,
java.util.Set termsSet)
extractTerms in interface IDocumentMatcher
public java.util.Map extractTerms(java.lang.String sessionID,
java.lang.String fromString)
ITermExtractor
extractTerms in interface ITermExtractorextractTerms in class BasicDocumentMatcherpublic java.lang.String render()
IDocumentMatcher
render in interface IDocumentMatcherpublic void initialize(org.w3c.dom.Element elem)
IConfigurable
initialize in interface IConfigurable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||