|
Joshua
open source statistical hierarchical phrase-based machine translation system
|
Public Member Functions | |
| BasicPhrase (byte language, String sentence) | |
| int[] | getWordIDs () |
| BasicPhrase | subPhrase (int start, int end) |
| ArrayList< Phrase > | getSubPhrases () |
| ArrayList< Phrase > | getSubPhrases (int maxLength) |
| int | size () |
| int | getWordID (int position) |
| String | toString () |
Private Member Functions | |
| BasicPhrase () | |
Private Attributes | |
| byte | language |
| int[] | words |
The simplest concrete implementation of Phrase.
| joshua.corpus.BasicPhrase.BasicPhrase | ( | byte | language, |
| String | sentence | ||
| ) |
| joshua.corpus.BasicPhrase.BasicPhrase | ( | ) | [private] |
| ArrayList<Phrase> joshua.corpus.BasicPhrase.getSubPhrases | ( | ) |
Gets all possible subphrases of this phrase, up to and including the phrase itself. For example, the phrase "I like cheese ." would return the following:
Implements joshua.corpus.Phrase.
| ArrayList<Phrase> joshua.corpus.BasicPhrase.getSubPhrases | ( | int | maxLength | ) |
Returns a list of subphrases only of length maxLength or smaller.
| maxLength | the maximum length phrase to return. |
Implements joshua.corpus.Phrase.
| int joshua.corpus.BasicPhrase.getWordID | ( | int | position | ) |
Returns the integer word id of the word at the specified position.
| position | Index of a word in this phrase. |
Implements joshua.corpus.Phrase.
| int [] joshua.corpus.BasicPhrase.getWordIDs | ( | ) |
This method gets the integer IDs of the phrase as an array of ints.
Implements joshua.corpus.Phrase.
| int joshua.corpus.BasicPhrase.size | ( | ) |
Returns the number of words in this phrase.
Implements joshua.corpus.Phrase.
| BasicPhrase joshua.corpus.BasicPhrase.subPhrase | ( | int | start, |
| int | end | ||
| ) |
creates a new phrase object from the indexes provided.
NOTE: subList merely creates a "view" of the existing Phrase object. Memory taken up by other Words in the Phrase is not freed since the underlying subList object still points to the complete Phrase List.
Implements joshua.corpus.Phrase.
| String joshua.corpus.BasicPhrase.toString | ( | ) |
Returns a human-readable String representation of the phrase.
The implementation of this method is slightly more efficient than that inherited from AbstractPhrase.
Reimplemented from joshua.corpus.AbstractPhrase.
byte joshua.corpus.BasicPhrase.language [private] |
int [] joshua.corpus.BasicPhrase.words [private] |