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

List of all members.

Public Member Functions

 BasicPhrase (byte language, String sentence)
int[] getWordIDs ()
BasicPhrase subPhrase (int start, int end)
ArrayList< PhrasegetSubPhrases ()
ArrayList< PhrasegetSubPhrases (int maxLength)
int size ()
int getWordID (int position)
String toString ()

Private Member Functions

 BasicPhrase ()

Private Attributes

byte language
int[] words

Detailed Description

The simplest concrete implementation of Phrase.

Author:
wren ng thornton wren@.nosp@m.user.nosp@m.s.sou.nosp@m.rcef.nosp@m.orge..nosp@m.net
Version:
$LastChangedDate$

Constructor & Destructor Documentation

joshua.corpus.BasicPhrase.BasicPhrase ( byte  language,
String  sentence 
)

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

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.

Implements joshua.corpus.Phrase.

Here is the call graph for this function:

ArrayList<Phrase> joshua.corpus.BasicPhrase.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()

Implements joshua.corpus.Phrase.

Here is the call graph for this function:

int joshua.corpus.BasicPhrase.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.

Implements joshua.corpus.Phrase.

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

Implements joshua.corpus.Phrase.

Returns the number of words in this phrase.

Returns:
the number of words in this phrase.

Implements joshua.corpus.Phrase.

Here is the caller graph for this function:

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.

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

Implements joshua.corpus.Phrase.

Here is the call graph for this function:

Returns a human-readable String representation of the phrase.

The implementation of this method is slightly more efficient than that inherited from AbstractPhrase.

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

Reimplemented from joshua.corpus.AbstractPhrase.

Here is the call graph for this function:


Member Data Documentation