Joshua
open source statistical hierarchical phrase-based machine translation system
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
joshua.corpus.Phrase Interface Reference
Inheritance diagram for joshua.corpus.Phrase:
[legend]

List of all members.

Public Member Functions

int[] getWordIDs ()
int getWordID (int position)
int size ()
List< PhrasegetSubPhrases ()
List< PhrasegetSubPhrases (int maxLength)
Phrase subPhrase (int start, int end)
int compareTo (Phrase other)
String toString ()

Detailed Description

Representation of a sequence of tokens.

Version:
LastChangedDate:
008-09-18 10:31:54 -0500 (Thu, 18 Sep 2008)

Member Function Documentation

Compares the two strings based on the lexicographic order of words defined in the Vocabulary.

Parameters:
otherthe object to compare to
Returns:
-1 if this object is less than the parameter, 0 if equals, 1 if greater

Implemented in joshua.corpus.AbstractPhrase.

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:

  • I
  • like
  • cheese
  • .
  • I like
  • like cheese
  • cheese .
  • I like cheese
  • like cheese .
  • I like cheese .
Returns:
List of all possible subphrases.

Implemented in joshua.corpus.ContiguousPhrase, and joshua.corpus.BasicPhrase.

Here is the caller graph for this function:

List<Phrase> joshua.corpus.Phrase.getSubPhrases ( int  maxLength)

Returns a list of subphrases only of length maxLength or smaller.

Parameters:
maxLengththe maximum length phrase to return.
Returns:
List of all possible subphrases of length maxLength or less
See also:
getSubPhrases()

Implemented in joshua.corpus.ContiguousPhrase, and joshua.corpus.BasicPhrase.

int joshua.corpus.Phrase.getWordID ( int  position)

Returns the integer word id of the word at the specified position.

Parameters:
positionIndex of a word in this phrase.
Returns:
the integer word id of the word at the specified position.

Implemented in joshua.corpus.BasicPhrase, and joshua.corpus.ContiguousPhrase.

Here is the caller graph for this function:

This method gets the integer IDs of the phrase as an array of ints.

Returns:
an int[] corresponding to the ID of each word in the phrase

Implemented in joshua.corpus.ContiguousPhrase, and joshua.corpus.BasicPhrase.

Returns the number of words in this phrase.

Returns:
the number of words in this phrase.

Implemented in joshua.corpus.ContiguousPhrase, and joshua.corpus.BasicPhrase.

Here is the caller graph for this function:

Phrase joshua.corpus.Phrase.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.

See also:
ArrayList::subList(int, int)

Implemented in joshua.corpus.ContiguousPhrase, and joshua.corpus.BasicPhrase.

Returns a human-readable String representation of the phrase.

Returns:
a human-readable String representation of the phrase.

Implemented in joshua.corpus.AbstractPhrase, and joshua.corpus.BasicPhrase.