Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-r --recursive オプション:安定するまで再帰翻訳 #28

Open
KEINOS opened this issue Jan 25, 2022 · 1 comment
Open

-r --recursive オプション:安定するまで再帰翻訳 #28

KEINOS opened this issue Jan 25, 2022 · 1 comment

Comments

@KEINOS
Copy link
Owner

KEINOS commented Jan 25, 2022

翻訳する言語の順番で、最初と最後の言語が同じ言語である場合に有効なオプション。

EN -> ES -> JA -> ES -> EN 」と翻訳した場合に、最初の EN と最後の EN の内容が同じになるまで、最終翻訳結果を元に再帰的に翻訳する機能。

手動で行う場合の例を以下に示します。原文よりも、'Returns true if the first argument contains "foo bar".' は、最も安定した翻訳が得られるフレーズであることがわかります。

$ qiitrans en es ja es en --verbose
- ストップワード: q
>>> It returns true if the 1st arg contains "foo bar".
EN -> ES: Devuelve true si el primer argumento contiene "foo bar".
ES -> JA: 第一引数に "foo bar "が含まれていれば、trueを返します。
JA -> ES: Devuelve true si el primer argumento contiene "foo bar".
再翻訳: Returns true if the first argument contains "foo bar".

>>> Returns true if the first argument contains "foo bar".
EN -> ES: Devuelve true si el primer argumento contiene "foo bar".
ES -> JA: 第一引数に "foo bar "が含まれていれば、trueを返します。
JA -> ES: Devuelve true si el primer argumento contiene "foo bar".
再翻訳: Returns true if the first argument contains "foo bar".

上記は以下と同じです。しかし、下記の場合は初回のループ(en es ja es en)で同じだった場合に、無駄なリクエストが発生することになります。

$ qiitrans en es ja es en es ja es en --verbose
- ストップワード: q
>>> It returns true if the first argument contains "foo bar".
EN -> ES: Devuelve true si el primer argumento contiene "foo bar".
ES -> JA: 第一引数に "foo bar "が含まれていれば、trueを返します。
JA -> ES: Devuelve true si el primer argumento contiene "foo bar".
ES -> EN: Returns true if the first argument contains "foo bar".
EN -> ES: Devuelve true si el primer argumento contiene "foo bar".
ES -> JA: 第一引数に "foo bar "が含まれていれば、trueを返します。
JA -> ES: Devuelve true si el primer argumento contiene "foo bar".
再翻訳: Returns true if the first argument contains "foo bar".
@KEINOS
Copy link
Owner Author

KEINOS commented Feb 8, 2022

--stable: 上記のショートハンドのオプション

このコマンドオプションを使用すると、翻訳が安定するまで再帰的に翻訳が繰り返されます。また、出力結果には、最終的に翻訳された各言語が表示されます。

$ qiitrans --stable en
- ストップワード: q
>>> It returns true if the first argument contains "foo bar".
> JA: 第一引数に "foo bar "が含まれていれば、trueを返します。
> ES: Devuelve true si el primer argumento contiene "foo bar".
Returns true if the first argument contains "foo bar".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant