|
Joshua
open source statistical hierarchical phrase-based machine translation system
|
Public Member Functions | |
| ContiguousPhrase (int startIndex, int endIndex, Corpus corpusArray) | |
| int[] | getWordIDs () |
| int | getWordID (int position) |
| int | size () |
| List< Phrase > | getSubPhrases () |
| List< Phrase > | getSubPhrases (int maxLength) |
| Phrase | subPhrase (int start, int end) |
Static Public Member Functions | |
| static void | main (String[] args) |
Protected Attributes | |
| int | startIndex |
| int | endIndex |
| Corpus | corpusArray |
ContiguousPhrase implements the Phrase interface by linking into indices within a corpus. This is intended to be a very low-memory implementation of the class.
| joshua.corpus.ContiguousPhrase.ContiguousPhrase | ( | int | startIndex, |
| int | endIndex, | ||
| Corpus | corpusArray | ||
| ) |
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.
| List<Phrase> joshua.corpus.ContiguousPhrase.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.ContiguousPhrase.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.ContiguousPhrase.getWordIDs | ( | ) |
This method copies the phrase into an array of ints. This method should be avoided if possible.
Implements joshua.corpus.Phrase.
| static void joshua.corpus.ContiguousPhrase.main | ( | String[] | args | ) | [static] |
Main contains test code
Returns the number of words in this phrase.
Implements joshua.corpus.Phrase.
| Phrase joshua.corpus.ContiguousPhrase.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.
Corpus joshua.corpus.ContiguousPhrase.corpusArray [protected] |
int joshua.corpus.ContiguousPhrase.endIndex [protected] |
int joshua.corpus.ContiguousPhrase.startIndex [protected] |