pt.tumba.cluster
Class Subsumption

java.lang.Object
  extended by pt.tumba.cluster.Subsumption

public class Subsumption
extends java.lang.Object

Description of the Class

Author:
bmartins

Field Summary
private  java.util.HashMap docRanking
           
private  java.util.HashMap documents
           
private  boolean fullTernary
           
private  Hierarchy hierarchy
           
private static java.util.HashMap ligators
          Lista de pavaras que podem ligar duas outras palavras, por forma a construir super frases
private static java.lang.String[] ligatorTerms
           
private  org.apache.log4j.Logger logger
           
private  int maxLevels
           
private  int numDocs
           
private  boolean onlyDouble
           
private  java.util.HashMap queryTerms
           
private static java.util.Random rand
          Random number generator for the quicksort algorithm
private  java.lang.String sentenceExclude
           
private static pt.tumba.util.QuasiStemmer stemmer
           
private  java.util.HashMap termFrequency
           
private  java.util.HashMap terms
           
private  boolean ternaryTerms
           
private  java.util.HashMap titles
           
 
Constructor Summary
Subsumption()
          Constructor for the Subsumption object
Subsumption(java.util.Vector contents)
          Constructor for the Subsumption object
Subsumption(java.util.Vector contents, java.lang.String query)
          Constructor for the Subsumption object
 
Method Summary
private  void addDocument(java.lang.Object document, java.lang.String text)
          Adds a feature to the Document attribute of the Subsumption object
private  void addTerm(java.lang.String t, java.lang.Object int1, int frequency)
          Adds a feature to the Term attribute of the Subsumption object
private  void computeHierarchy()
          Description of the Method
private  void computeHierarchy(java.lang.String term, java.util.HashMap terms2, Hierarchy hierarchy, int level)
          Description of the Method
private static java.util.List exchangePos(java.util.List v, int p1, int p2)
          Description of the Method
 java.lang.String genderAndCase(java.lang.String aux)
           
 java.util.List getDocuments(java.lang.String path)
          Gets the documents attribute of the Subsumption object
 java.util.Vector getHierarchy()
          Gets the hierarchy attribute of the Subsumption object
private  java.util.Vector getHierarchy(java.lang.String p)
          Gets the hierarchy attribute of the Subsumption object
 java.util.List getTerms(java.lang.String p)
          Gets the terms attribute of the Subsumption object
 java.lang.String getTitle(java.lang.String url)
          Gets the title attribute of the Subsumption object
private  java.util.Vector getUnorderedDocuments(java.lang.String p)
          Gets the unorderedDocuments attribute of the Subsumption object
 void makeHierarchy()
          Description of the Method
 boolean occurInSameDocuments(java.lang.String term1, java.lang.String term2)
          Description of the Method
private  Hierarchy pruneHierarchy(Hierarchy h2, Hierarchy parent, boolean s2)
          Description of the Method
private  Hierarchy pruneHierarchy2(Hierarchy h, Hierarchy parent)
           
 Hierarchy pruneHierarchyMaxNodes(Hierarchy hierarchy, int max)
           
private  void removeTerms()
          Description of the Method
 void setSentenceExclude(java.lang.String s)
          Sets the sentenceExclude attribute of the Subsumption object
private  void termSelection()
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stemmer

private static pt.tumba.util.QuasiStemmer stemmer

ligators

private static java.util.HashMap ligators
Lista de pavaras que podem ligar duas outras palavras, por forma a construir super frases


ligatorTerms

private static java.lang.String[] ligatorTerms

rand

private static java.util.Random rand
Random number generator for the quicksort algorithm


docRanking

private java.util.HashMap docRanking

documents

private java.util.HashMap documents

hierarchy

private Hierarchy hierarchy

numDocs

private int numDocs

queryTerms

private java.util.HashMap queryTerms

sentenceExclude

private java.lang.String sentenceExclude

termFrequency

private java.util.HashMap termFrequency

terms

private java.util.HashMap terms

titles

private java.util.HashMap titles

ternaryTerms

private boolean ternaryTerms

onlyDouble

private boolean onlyDouble

fullTernary

private boolean fullTernary

maxLevels

private int maxLevels

logger

private org.apache.log4j.Logger logger
Constructor Detail

Subsumption

public Subsumption()
Constructor for the Subsumption object


Subsumption

public Subsumption(java.util.Vector contents)
Constructor for the Subsumption object

Parameters:
contents - Description of the Parameter

Subsumption

public Subsumption(java.util.Vector contents,
                   java.lang.String query)
Constructor for the Subsumption object

Parameters:
contents - Description of the Parameter
query - Description of the Parameter
Method Detail

exchangePos

private static java.util.List exchangePos(java.util.List v,
                                          int p1,
                                          int p2)
Description of the Method

Parameters:
v - Description of the Parameter
p1 - Description of the Parameter
p2 - Description of the Parameter
Returns:
Description of the Return Value

addDocument

private void addDocument(java.lang.Object document,
                         java.lang.String text)
Adds a feature to the Document attribute of the Subsumption object

Parameters:
document - The feature to be added to the Document attribute
text - The feature to be added to the Document attribute

addTerm

private void addTerm(java.lang.String t,
                     java.lang.Object int1,
                     int frequency)
Adds a feature to the Term attribute of the Subsumption object

Parameters:
term - The feature to be added to the Term attribute
int1 - The feature to be added to the Term attribute
frequency - The feature to be added to the Term attribute

computeHierarchy

private void computeHierarchy()
Description of the Method


pruneHierarchyMaxNodes

public Hierarchy pruneHierarchyMaxNodes(Hierarchy hierarchy,
                                        int max)

computeHierarchy

private void computeHierarchy(java.lang.String term,
                              java.util.HashMap terms2,
                              Hierarchy hierarchy,
                              int level)
Description of the Method

Parameters:
term - Description of the Parameter
terms2 - Description of the Parameter
hierarchy - Description of the Parameter
level - Description of the Parameter

getDocuments

public java.util.List getDocuments(java.lang.String path)
Gets the documents attribute of the Subsumption object

Parameters:
path - Description of the Parameter
Returns:
The documents value

getHierarchy

public java.util.Vector getHierarchy()
Gets the hierarchy attribute of the Subsumption object

Returns:
The hierarchy value

getHierarchy

private java.util.Vector getHierarchy(java.lang.String p)
Gets the hierarchy attribute of the Subsumption object

Parameters:
path - Description of the Parameter
Returns:
The hierarchy value

getTerms

public java.util.List getTerms(java.lang.String p)
Gets the terms attribute of the Subsumption object

Parameters:
path - Description of the Parameter
Returns:
The terms value

getTitle

public java.lang.String getTitle(java.lang.String url)
Gets the title attribute of the Subsumption object

Parameters:
url - Description of the Parameter
Returns:
The title value

getUnorderedDocuments

private java.util.Vector getUnorderedDocuments(java.lang.String p)
Gets the unorderedDocuments attribute of the Subsumption object

Parameters:
path - Description of the Parameter
Returns:
The unorderedDocuments value

makeHierarchy

public void makeHierarchy()
Description of the Method


occurInSameDocuments

public boolean occurInSameDocuments(java.lang.String term1,
                                    java.lang.String term2)
Description of the Method

Parameters:
term1 - Description of the Parameter
term2 - Description of the Parameter
Returns:
Description of the Return Value

pruneHierarchy

private Hierarchy pruneHierarchy(Hierarchy h2,
                                 Hierarchy parent,
                                 boolean s2)
Description of the Method

Parameters:
h - Description of the Parameter
parent - Description of the Parameter
Returns:
Description of the Return Value

pruneHierarchy2

private Hierarchy pruneHierarchy2(Hierarchy h,
                                  Hierarchy parent)

removeTerms

private void removeTerms()
Description of the Method

Parameters:
sentence - Description of the Parameter

setSentenceExclude

public void setSentenceExclude(java.lang.String s)
Sets the sentenceExclude attribute of the Subsumption object

Parameters:
s - The new sentenceExclude value

genderAndCase

public java.lang.String genderAndCase(java.lang.String aux)

termSelection

private void termSelection()
Description of the Method