kwic
Class Phrase

java.lang.Object
  extended by kwic.Phrase

public class Phrase
extends Object

Represent a phrase


Field Summary
protected  String phrase
           
 
Constructor Summary
Phrase(String s)
           
 
Method Summary
protected static String cleanUp(String s)
          Filter the supplied String (which is the String of a Phrase presumably) into a canonical form for subsequent matching.
 boolean equals(Object o)
          The behavior of this lab depends on how you view this method.
 Set<Word> getWords()
          Provide the words of a phrase.
 int hashCode()
          This method must also be properly defined, or else your HashSet structure won't operate properly.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

phrase

protected final String phrase
Constructor Detail

Phrase

public Phrase(String s)
Method Detail

getWords

public Set<Word> getWords()
Provide the words of a phrase. Each word may have to be cleaned up: punctuation removed, put into lower case


equals

public boolean equals(Object o)
The behavior of this lab depends on how you view this method. Are two phrases the same because they have the same words? Or are they the same because they are string-equlivalent. The above phrases have the same words but are different strings.

Overrides:
equals in class Object

hashCode

public int hashCode()
This method must also be properly defined, or else your HashSet structure won't operate properly.

Overrides:
hashCode in class Object

cleanUp

protected static String cleanUp(String s)
Filter the supplied String (which is the String of a Phrase presumably) into a canonical form for subsequent matching. The acutal filtering depends on what you consider to be insignificant in terms of matching.


toString

public String toString()
Overrides:
toString in class Object