com.raritantechnologies.concept.classifier
Class WildcardDocumentMatcher

java.lang.Object
  extended bycom.raritantechnologies.concept.classifier.BasicDocumentMatcher
      extended bycom.raritantechnologies.concept.classifier.WildcardDocumentMatcher
All Implemented Interfaces:
IConfigurable, IDocumentMatcher, ITermExtractor

public class WildcardDocumentMatcher
extends BasicDocumentMatcher
implements IDocumentMatcher

used to match documents if string pattern is present in the document.

XML Configuration Template:
  <DocumentMatcher class="com.raritantechnologies.concept.classifier.WildcardDocumentMatcher"
                      wildcardPattern="[ pattern to find in tokens *[A-Za-z0-9]*"
                      caseSensitive="[ true|false(default) ]" >

  </DocumentMatcher>
 


Constructor Summary
WildcardDocumentMatcher()
           
WildcardDocumentMatcher(java.lang.String wildcardPattern)
           
WildcardDocumentMatcher(java.lang.String wildcardPattern, boolean caseSensitive)
           
 
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
 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, 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, getMatchCriteria
 

Constructor Detail

WildcardDocumentMatcher

public WildcardDocumentMatcher()

WildcardDocumentMatcher

public WildcardDocumentMatcher(java.lang.String wildcardPattern)

WildcardDocumentMatcher

public WildcardDocumentMatcher(java.lang.String wildcardPattern,
                               boolean caseSensitive)
Method Detail

setName

public void setName(java.lang.String name)
Description copied from interface: IDocumentMatcher
Unique key that identifies this IDocumentMatcher

Specified by:
setName in interface IDocumentMatcher
Overrides:
setName in class BasicDocumentMatcher

getName

public java.lang.String getName()
Specified by:
getName in interface IDocumentMatcher
Overrides:
getName in class BasicDocumentMatcher

matches

public boolean matches(IndexedDocument document)
Description copied from interface: IDocumentMatcher
returns true if the matcher matches the IndexedDocument, false otherwise.

Specified by:
matches in interface IDocumentMatcher
Specified by:
matches in class BasicDocumentMatcher

isStopWord

public boolean isStopWord(IndexedDocument document)
Description copied from interface: IDocumentMatcher
Adds stop word support. This is typically done by checking if the matchers terms are stop words by calling the IndexedDocument method isStopWord( string ). See TermDocumentMatcher.

Specified by:
isStopWord in interface IDocumentMatcher
Overrides:
isStopWord in class BasicDocumentMatcher

getTermSet

public java.util.Set getTermSet()
Description copied from interface: IDocumentMatcher
returns the list of terms in all contained TermDocumentMatchers

Specified by:
getTermSet in interface IDocumentMatcher
Overrides:
getTermSet in class BasicDocumentMatcher

getPhraseSet

public java.util.Set getPhraseSet()
Description copied from interface: IDocumentMatcher
returns the list of phrases in all contained PhraseDocumentMatchers

Specified by:
getPhraseSet in interface IDocumentMatcher
Overrides:
getPhraseSet in class BasicDocumentMatcher

collectTermSet

protected void collectTermSet(java.util.HashSet termSet)
Specified by:
collectTermSet in class BasicDocumentMatcher

collectPhraseSet

protected void collectPhraseSet(java.util.HashSet phraseSet)
Specified by:
collectPhraseSet in class BasicDocumentMatcher

extractTerms

public void extractTerms(IndexedDocument fromDocument,
                         java.util.HashMap termsMap)
Description copied from interface: IDocumentMatcher
Extracts the matching terms contained in the document.

Specified by:
extractTerms in interface IDocumentMatcher
Specified by:
extractTerms in class BasicDocumentMatcher

extractTerms

public void extractTerms(IndexedDocument fromDocument,
                         java.util.Set termsSet)
Specified by:
extractTerms in interface IDocumentMatcher

extractTerms

public java.util.Map extractTerms(java.lang.String sessionID,
                                  java.lang.String fromString)
Description copied from interface: ITermExtractor
returns a map of terms - key is the term, value is either an AttributeWordsTagger or an Attribute string

Specified by:
extractTerms in interface ITermExtractor
Overrides:
extractTerms in class BasicDocumentMatcher

render

public java.lang.String render()
Description copied from interface: IDocumentMatcher
Renders a human-readable version of the matcher's logic.

Specified by:
render in interface IDocumentMatcher

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IConfigurable
Initializes the object from an XML tag or element. This method is called by the Framework as part of the application initializtion. see ConfigurationManager, XMLConfigurationManager, XMLSearchFieldMapFactory, XMLSearchSourceFactory. Configurable objects that are owned or contained by other configurable objects will be initialized in by the parent object.

Specified by:
initialize in interface IConfigurable