edu.umd.hooka
Class IntAugmentedPhrase

java.lang.Object
  extended by edu.umd.hooka.IntAugmentedPhrase
All Implemented Interfaces:
Cloneable, Comparable, Writable, WritableComparable

public class IntAugmentedPhrase
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. In this version, each word has an int attached to it.

Author:
redpony

Field Summary
 byte _language
           
 int[] _values
           
 int[] _words
           
 
Constructor Summary
IntAugmentedPhrase()
           
IntAugmentedPhrase(int[] p, int lang, int[] v)
           
 
Method Summary
 Object clone()
           
 int compareTo(Object o)
           
 boolean equals(Object o)
           
static IntAugmentedPhrase fromString(int lang, String sentence, Vocab voc)
           
 byte getLanguage()
           
 IntAugmentedPhrase getSubPhrase(int start, int end)
           
 int[] getValues()
           
 int[] getWords()
           
 int hashCode()
           
 void readFields(DataInput in)
           
 void setLanguage(int l)
           
 void setValues(int[] values)
           
 void setWords(int[] words)
           
 int size()
           
 String toString()
           
 String toString(Vocab voc)
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_language

public byte _language

_words

public int[] _words

_values

public int[] _values
Constructor Detail

IntAugmentedPhrase

public IntAugmentedPhrase()

IntAugmentedPhrase

public IntAugmentedPhrase(int[] p,
                          int lang,
                          int[] v)
Method Detail

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()

getValues

public int[] getValues()

getLanguage

public byte getLanguage()

setLanguage

public void setLanguage(int l)

getSubPhrase

public IntAugmentedPhrase getSubPhrase(int start,
                                       int end)

fromString

public static IntAugmentedPhrase 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)

setValues

public void setValues(int[] values)

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface Writable
Throws:
IOException