com.raritantechnologies.concept
Class Keyword

java.lang.Object
  extended bycom.raritantechnologies.concept.Keyword

public class Keyword
extends java.lang.Object

Maintains associative relationships between keywords based on proximity of keywords to each other within a set of processed documents.


Developed by Raritan Technologies .

Author:
Ted Sullivan

Nested Class Summary
 class Keyword.AssociatedKeywordData
           
 
Constructor Summary
Keyword(java.lang.String keyword)
           
Keyword(java.lang.String keyword, int location)
           
 
Method Summary
 void addDocument(Document doc)
          This method builds an associated keywords map.
 void addDocument(Document doc, int minAssocDistance)
          Extracts the Keywords from a Document.
 void addDocumentUsingSentences(Document doc)
           
 OrderedMapEntry[] getAssociatedDocumentSentences(java.lang.String keyword)
          Returns an array of delimited strings with docName|sentence
 java.util.HashMap getAssociatedKeywords()
          returns a map of association strength to Keyword
 java.util.TreeMap getAssociatedKeywords(double minFraction)
           
 java.lang.String getCategory()
           
 java.lang.String getKeyword()
           
 int getNDocuments()
           
static OrderedMap getOrderedKeywordAssociationMap(java.util.HashMap keywordAssociationMap)
          returns an OrderedMap of keyword associations in which the order of the keywords is based on the number of associations.
static java.util.HashMap mergeAssociatedKeywordMaps(java.util.HashMap assocKeywords1, java.util.HashMap assocKeywords2)
          Merges two maps of keyword --> AssociatedKeywordData objects.
 void setCategory(java.lang.String category)
           
 void setLocation(int location)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Keyword

public Keyword(java.lang.String keyword)

Keyword

public Keyword(java.lang.String keyword,
               int location)
Method Detail

getKeyword

public java.lang.String getKeyword()

setCategory

public void setCategory(java.lang.String category)

getCategory

public java.lang.String getCategory()

addDocument

public void addDocument(Document doc)
This method builds an associated keywords map.


addDocument

public void addDocument(Document doc,
                        int minAssocDistance)
Extracts the Keywords from a Document. If the keyword is within a certain distance from this keyword, add it as an associated keyword.


addDocumentUsingSentences

public void addDocumentUsingSentences(Document doc)

getAssociatedKeywords

public java.util.HashMap getAssociatedKeywords()
returns a map of association strength to Keyword


getAssociatedKeywords

public java.util.TreeMap getAssociatedKeywords(double minFraction)

mergeAssociatedKeywordMaps

public static java.util.HashMap mergeAssociatedKeywordMaps(java.util.HashMap assocKeywords1,
                                                           java.util.HashMap assocKeywords2)
Merges two maps of keyword --> AssociatedKeywordData objects.


getOrderedKeywordAssociationMap

public static OrderedMap getOrderedKeywordAssociationMap(java.util.HashMap keywordAssociationMap)
returns an OrderedMap of keyword associations in which the order of the keywords is based on the number of associations.


getAssociatedDocumentSentences

public OrderedMapEntry[] getAssociatedDocumentSentences(java.lang.String keyword)
Returns an array of delimited strings with docName|sentence


getNDocuments

public int getNDocuments()

setLocation

public void setLocation(int location)