|
Joshua
open source statistical hierarchical phrase-based machine translation system
|
Public Member Functions | |
| DecoderThread (List< GrammarFactory > grammarFactories, List< FeatureFunction > featureFunctions, List< StateComputer > stateComputers, InputHandler inputHandler) throws IOException | |
| void | run () |
| void | translateAll () throws IOException |
| HyperGraph | translate (Sentence sentence, String oracleSentence) throws IOException |
Package Attributes | |
| DiskHyperGraph | hypergraphSerializer |
Private Attributes | |
| final List< GrammarFactory > | grammarFactories |
| final List< FeatureFunction > | featureFunctions |
| final List< StateComputer > | stateComputers |
| final InputHandler | inputHandler |
| BufferedWriter | nbestWriter |
| final KBestExtractor | kbestExtractor |
Static Private Attributes | |
| static final Logger | logger = Logger.getLogger(DecoderThread.class.getName()) |
This class handles decoding of individual Sentence objects (which can represent plain sentences or lattices). A single sentence can be decoded by a call to translate() and, if an InputHandler is used, many sentences can be decoded in a thread-safe manner via a single call to translateAll(), which continually queries the InputHandler for sentences until they have all been consumed and translated.
The DecoderFactory class is responsible for launching the threads.
| joshua.decoder.DecoderThread.DecoderThread | ( | List< GrammarFactory > | grammarFactories, |
| List< FeatureFunction > | featureFunctions, | ||
| List< StateComputer > | stateComputers, | ||
| InputHandler | inputHandler | ||
| ) | throws IOException |
| void joshua.decoder.DecoderThread.run | ( | ) |
| HyperGraph joshua.decoder.DecoderThread.translate | ( | Sentence | sentence, |
| String | oracleSentence | ||
| ) | throws IOException |
Translate a sentence.
| sentence | The sentence to be translated. |
| oracleSentence |
| void joshua.decoder.DecoderThread.translateAll | ( | ) | throws IOException |
Repeatedly fetches input sentences and calls translate() on them, registering the results with the InputManager upon completion.
final List<FeatureFunction> joshua.decoder.DecoderThread.featureFunctions [private] |
final List<GrammarFactory> joshua.decoder.DecoderThread.grammarFactories [private] |
final InputHandler joshua.decoder.DecoderThread.inputHandler [private] |
final KBestExtractor joshua.decoder.DecoderThread.kbestExtractor [private] |
final Logger joshua.decoder.DecoderThread.logger = Logger.getLogger(DecoderThread.class.getName()) [static, private] |
BufferedWriter joshua.decoder.DecoderThread.nbestWriter [private] |
final List<StateComputer> joshua.decoder.DecoderThread.stateComputers [private] |