edu.umd.hooka
Class Phrase
java.lang.Object
edu.umd.hooka.Phrase
- All Implemented Interfaces:
- Cloneable, Comparable, Writable, WritableComparable
public class Phrase
- extends Object
- implements WritableComparable, Cloneable
Represents a string of one or more words that may be a word,
phrase, sentence, or unit larger than a sentence.
- Author:
- chris
Phrase
public Phrase()
Phrase
public Phrase(int[] p,
int lang)
clone
public Object clone()
- Overrides:
clone in class Object
size
public int size()
equals
public boolean equals(Object o)
- Overrides:
equals in class Object
toString
public String toString()
- Overrides:
toString in class Object
compareTo
public int compareTo(Object o)
- Specified by:
compareTo in interface Comparable
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
toString
public String toString(Vocab voc)
getWords
public int[] getWords()
getWordsWithoutDuplicates
public TreeSet<Integer> getWordsWithoutDuplicates()
getLanguage
public byte getLanguage()
setLanguage
public void setLanguage(int l)
getSubPhrase
public Phrase getSubPhrase(int start,
int end)
fromString
public static Phrase fromString(int lang,
String sentence,
Vocab voc)
readFields
public void readFields(DataInput in)
throws IOException
- Specified by:
readFields in interface Writable
- Throws:
IOException
setWords
public void setWords(int[] words)
write
public void write(DataOutput out)
throws IOException
- Specified by:
write in interface Writable
- Throws:
IOException