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

List of all members.

Public Member Functions

 TranslationRequest (InputStream in, JoshuaConfiguration joshuaConfiguration)
int size ()
synchronized Sentence next ()
void shutdown ()

Private Attributes

final JoshuaConfiguration joshuaConfiguration
BufferedReader reader = null
int sentenceNo = -1
Sentence nextSentence = null
boolean isShutDown = false

Static Private Attributes

static final Charset FILE_ENCODING = Charset.forName("UTF-8")

Detailed Description

This class is an iterator over inputs, which are turned into Sentence objects.

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

Constructor & Destructor Documentation


Member Function Documentation

Here is the call graph for this function:

Here is the caller graph for this function:

When the client socket is interrupted, we need to shut things down. On the source side, the TranslationRequest could easily have buffered a lot of lines and so will keep discovering sentences to translate, but the output Translation objects will start throwing exceptions when trying to print to the closed socket. When that happens, we call this function() so that we can tell next() to stop returning translations, which in turn will cause it to stop asking for them.

Note that we don't go to the trouble of shutting down existing DecoderThreads. This would be good to do, but for the moment would require more bookkeeping than we want to do.

Here is the caller graph for this function:

Here is the caller graph for this function:


Member Data Documentation

final Charset joshua.decoder.io.TranslationRequest.FILE_ENCODING = Charset.forName("UTF-8") [static, private]
BufferedReader joshua.decoder.io.TranslationRequest.reader = null [private]