|
Joshua
open source statistical hierarchical phrase-based machine translation system
|
Public Member Functions | |
| int | hashCode () |
| boolean | equals (Object o) |
| int | compareTo (Phrase other) |
| String | toString () |
Static Public Attributes | |
| static final int | HASH_SEED = 17 |
| static final int | HASH_OFFSET = 37 |
Protected Member Functions | |
| int[] | splitSentence (String sentence) |
This class provides a skeletal implementation of the base methods likely to be common to most or all implementations of the Phrase interface.
| int joshua.corpus.AbstractPhrase.compareTo | ( | Phrase | other | ) |
Compares the two strings based on the lexicographic order of words defined in the Vocabulary.
| other | the object to compare to |
| ClassCastException | if the passed object is not of type Phrase |
Implements joshua.corpus.Phrase.
| boolean joshua.corpus.AbstractPhrase.equals | ( | Object | o | ) |
Two phrases are their word IDs are the same. Note that this could give a false positive if their Vocabularies were different but their IDs were somehow the same.
Uses the standard java approach of calculating hashCode. Start with a seed, add in every value multiplying the exsiting hash times an offset.
| int [] joshua.corpus.AbstractPhrase.splitSentence | ( | String | sentence | ) | [protected] |
Splits a sentence (on white space), then looks up the integer representations of each word using the supplied symbol table.
| sentence | White-space separated String of words. |
| String joshua.corpus.AbstractPhrase.toString | ( | ) |
Returns a string representation of the phrase.
Implements joshua.corpus.Phrase.
Reimplemented in joshua.corpus.BasicPhrase.
final int joshua.corpus.AbstractPhrase.HASH_OFFSET = 37 [static] |
offset used in has code generation
final int joshua.corpus.AbstractPhrase.HASH_SEED = 17 [static] |
seed used in hash code generation