jp.go.nict.langrid.service_1_2.backtranslation
インタフェース AsyncBackTranslationWithTemporalDictionaryService


public interface AsyncBackTranslationWithTemporalDictionaryService

一時辞書を用いる非同期折り返し翻訳のインターフェース。

作成者:
Takao Nakaguchi

メソッドの概要
 AsyncBackTranslationResult getCurrentResult(String token)
          現在翻訳できている文章を取得する。
 String startBackTranslation(String sourceLang, String intermediateLang, String[] sources, Translation[] temporalDict, String dictTargetLang)
          非同期折り返し翻訳を行う。
 void terminate(String token)
          実行中の翻訳処理を中断する。
 

メソッドの詳細

startBackTranslation

String startBackTranslation(String sourceLang,
                            String intermediateLang,
                            String[] sources,
                            Translation[] temporalDict,
                            String dictTargetLang)
                            throws InvalidParameterException,
                                   ProcessFailedException
非同期折り返し翻訳を行う。内部の翻訳スレッドが足りない場合、少なくとも1つが空くまで待機する。

パラメータ:
sourceLang - 翻訳元言語(RFC3066準拠)
intermediateLang - 中間言語(RFC3066準拠)
sources - 翻訳する文字列の配列
temporalDict - 翻訳時に使用する対訳辞書データ
dictTargetLang - 辞書データの対象言語(targetLang)
戻り値:
結果取得用トークン
例外:
InvalidParameterException - 不正なパラメータが渡された
ProcessFailedException - 翻訳処理に失敗した

getCurrentResult

AsyncBackTranslationResult getCurrentResult(String token)
                                            throws InvalidParameterException,
                                                   ProcessFailedException
現在翻訳できている文章を取得する。 結果が0件の場合は、少なくとも1件が翻訳されるまで待機する。 翻訳が終了している場合、空配列を返す。

パラメータ:
token - 結果取得用トークン
戻り値:
折り返し翻訳結果
例外:
InvalidParameterException - An invalid parameter was passed
ProcessFailedException - Translation process failed

terminate

void terminate(String token)
               throws InvalidParameterException,
                      ProcessFailedException
実行中の翻訳処理を中断する。

パラメータ:
token - 結果取得用トークン
例外:
InvalidParameterException - An invalid parameter was passed
ProcessFailedException - Translation process failed