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

List of all members.

Public Member Functions

 Translations (TranslationRequest request)
void finish ()
void record (Translation translation)
Translation next ()

Private Attributes

TranslationRequest request = null
int currentID = 0
LinkedList< Translationtranslations = null
boolean spent = false

Detailed Description

This class represents a streaming sequence of translations. It is returned by the main entry point to the Decoder object, the call to decodeAll. The translations here are parallel to the input sentences in the corresponding TranslationRequest object. Because of parallelization, the translated sentences might be computed out of order. Each Translation is sent to this Translations object by a DecoderThreadRunner via the record() function, which places the Translation in the right place. When the next translation in a sequence is available, next() is notified.

Author:
Matt Post post@.nosp@m.cs.j.nosp@m.hu.ed.nosp@m.u

Constructor & Destructor Documentation


Member Function Documentation

This is called when null is received from the TranslationRequest, indicating that there are no more input sentences to translated. That in turn means that the request size will no longer grow. We then notify any waiting thread if the last ID we've processed is the last one, period.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the next Translation, blocking if necessary until it's available, since the next Translation might not have been produced yet.

Here is the call graph for this function:

Here is the caller graph for this function:

This is called whenever a translation is completed by one of the decoder threads. There may be a current output thread waiting for the current translation, which is determined by checking if the ID of the translation is the same as the one being waited for (currentID). If so, the thread waiting for it is notified.

Parameters:
translation

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

boolean joshua.decoder.Translations.spent = false [private]