de.aitools.ir.retrievalmodels.representation.suffixtree
Class ConstructionAlgorithmWotd

java.lang.Object
  extended by de.aitools.ir.retrievalmodels.representation.suffixtree.ConstructionAlgorithmWotd

public class ConstructionAlgorithmWotd
extends java.lang.Object

This class implements the suffix tree construction algorithm write-only-top-down. By calling the constructor with a Collection of texts and then initialiseSuffixTree() the suffix tree will be initialized. All elements of the Collection must be an instance of StringBuffer and match the following regular expression: \S+([ ]\S+)*. The algorithm will parse the string word-wise which means that the edge labels of any resulting suffix tree will be one or more words.

Version:
aitools 3.0 $Id: ConstructionAlgorithmWotd.java,v 1.1 2010/05/19 15:48:58 poma1006 Exp $
Author:
Martin Potthast

Constructor Summary
ConstructionAlgorithmWotd()
          Constructor for write-only-top-down algorithm.
 
Method Summary
 java.util.List<java.lang.String> getVocabulary()
           
 SuffixTreeNode initialiseSuffixTree(java.lang.Iterable<java.lang.String> texts)
          This method initialises the suffix tree.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstructionAlgorithmWotd

public ConstructionAlgorithmWotd()
Constructor for write-only-top-down algorithm. By calling initialiseSuffixTree after constructing an instance of this class a suffix tree for the Collection of texts will be built. All texts must be an instance of StringBuffer.

Parameters:
texts - Collection containing all texts as instance of StringBuffer to build a suffix tree for.
Method Detail

initialiseSuffixTree

public SuffixTreeNode initialiseSuffixTree(java.lang.Iterable<java.lang.String> texts)
This method initialises the suffix tree. It should be called directly after constructing an instance of this class. It will return an instance of TreeStructure which wraps the structure of the tree containing the suffix tree.

Returns:
A suffix tree wrapped by a TreeStructure instance.

getVocabulary

public java.util.List<java.lang.String> getVocabulary()
Returns:
Returns the words.