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

List of all members.

Public Member Functions

 ContiguousPhrase (int startIndex, int endIndex, Corpus corpusArray)
int[] getWordIDs ()
int getWordID (int position)
int size ()
List< PhrasegetSubPhrases ()
List< PhrasegetSubPhrases (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

Detailed Description

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.

Author:
Chris Callison-Burch
Since:
29 May 2008
Version:
LastChangedDate:
008-09-18 12:47:23 -0500 (Thu, 18 Sep 2008)

Constructor & Destructor Documentation

joshua.corpus.ContiguousPhrase.ContiguousPhrase ( int  startIndex,
int  endIndex,
Corpus  corpusArray 
)

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:
ArrayList of all possible subphrases.

Implements joshua.corpus.Phrase.

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Implements joshua.corpus.Phrase.

Here is the call graph for this function:

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.

Here is the call graph for this function:

This method copies the phrase into an array of ints. This method should be avoided if possible.

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

Implements joshua.corpus.Phrase.

Here is the call graph for this function:

static void joshua.corpus.ContiguousPhrase.main ( String[]  args) [static]

Main contains test code

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:

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.

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

Implements joshua.corpus.Phrase.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation