np8*_*np8 31 command-line dictionary translation
我想的话翻译从英语语言X槽终端
如果可能,有哪些词典?
是否可以通过终端使用webxicon.org 等在线服务?
pre*_*ise 33
您可以安装dictd
服务器并使用 Freedict 词典数据库进行单词翻译。
安装字典:
sudo apt-get install dictd
Run Code Online (Sandbox Code Playgroud)
安装翻译数据库。例如。dict-freedict-eng-fra用于英语到法语的翻译,dict-freedict-eng-spa用于英语到西班牙语的翻译。
sudo apt-get install dict-freedict-eng-fra
sudo apt-get install dict-freedict-eng-spa
Run Code Online (Sandbox Code Playgroud)
用法:
查看数据库列表:
dict -D
Run Code Online (Sandbox Code Playgroud)
使用特定的数据库,例如。英语到西班牙语的翻译:
dict -d fd-eng-spa "how are you?"
Run Code Online (Sandbox Code Playgroud)
安装libtranslate-bin
:
sudo apt-get install libtranslate-bin
Run Code Online (Sandbox Code Playgroud)
例如。使用在线谷歌翻译引擎:
echo "what are you doing" | translate-bin -s google -f en -t fr
Run Code Online (Sandbox Code Playgroud)
安装英语词典数据库(gcide 、wn、devil):
sudo apt-get install dict-gcide
sudo apt-get install dict-wn
sudo apt-get install dict-devil
Run Code Online (Sandbox Code Playgroud)
安装英文同义词库(moby-thesaurus):
sudo apt-get install dict-moby-thesaurus
Run Code Online (Sandbox Code Playgroud)
用法:
使用特定的数据库(例如 WordNet - wn):
dict -d wn "dictionary"
Run Code Online (Sandbox Code Playgroud)不指定 dict-database 将输出所有可用数据库的定义/翻译/同义词库。例如。
dict "dictionary"
Run Code Online (Sandbox Code Playgroud)May*_*hux 11
Translate Shell(前 Google Translate CLI)是一种工具,可让您使用 Google Translate 从命令行翻译文本。
$ wget git.io/trans
$ chmod +x ./trans
Run Code Online (Sandbox Code Playgroud)
或者
sudo apt install translate-shell
Run Code Online (Sandbox Code Playgroud)
或者
$ git clone https://github.com/soimort/translate-shell
$ cd translate-shell/
$ make
$ [sudo] make install
Run Code Online (Sandbox Code Playgroud)
翻译
trans en:de "The quick brown fox jumps over the lazy dog" # Translate to German (de)
trans es: "Igualdad, fraternidad y libertad" # From Spanish to your `locale`
trans :fr "Igualdad, fraternidad y libertad" # From your `locale` to French
trans -b :fr "Igualdad, fraternidad y libertad" # Same but `-brief`
Run Code Online (Sandbox Code Playgroud)
作为字典:当使用 lang from==to 或 -d 参数时,谷歌翻译可以作为字典使用
trans -d fr: mot
Run Code Online (Sandbox Code Playgroud)
可以在官方网站中找到其他信息和一些示例
小智 5
根据您想要的语言,通过终端查看Apertium以进行离线机器翻译。它似乎主要关注浪漫语言(ES、FR、PT、CAT、OCC ..),但看起来他们正在慢慢添加各种新语言。
对于西班牙语,您将安装:
sudo apt install apertium apertium-en-es
echo "Hola Mundo." | apertium -a es-en
> Hello world.
Run Code Online (Sandbox Code Playgroud)
它是基于终端的,但也有一个基本的 GUI: apertium-tolk
存储库中的版本较旧,如果您想要更新的版本,请按照安装说明进行操作。