Categorygithub.com/barryz/yd
modulepackage
1.0.0
Repository: https://github.com/barryz/yd.git
Documentation: pkg.go.dev

# README

yd 是一个用于翻译单词的命令行工具。

安装

go get -u github.com/barryz/yd

二进制下载

暂无

使用

翻译单词

yd -w $word

翻译单词(美式发音)

yd -s -w $word

翻译结果导入 Anki

前提是本机已安装 Anki , 且配置好 AnkiConnect Add-ons。

export ANKI_DECK_NAME=$your_anki_deck_name # 你的 anki deck 名称
yd -w $word -anki

为了简化,可以使用 alias :

echo 'alias tra="ANKI_DECK_NAME=$your_anki_deck_name yd -s -anki -w"' >> ~/.zshrc
# or
echo 'alias tra="ANKI_DECK_NAME=$your_anki_deck_name yd -s -anki -w"' >> ~/.bashrc

# import the result into Anki when you query the word
tra $word

Anki 相关

TODO

  • 终端发音支持
  • 支持文本翻译
  • 支持汉英翻译
  • 其他

# Functions

GetDeck get anki deck name from environment var.
NewAnkiClient creates an new ank client.
NewUSAudio creates an new us speech audio.
NewYouDaoAPIClient creates a new YouDaoAPIClient.

# Constants

AnkiConnectAPI http api endpoint for connect to anki web.
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
AnkiClient http client that do short connection with anki api endpoint.
No description provided by the author
No description provided by the author
WordResp response abstraction with word translation from youdao api.
USAudio us speech audio.
WordResp response abstraction with word translation from youdao api.
YouDaoAPIClient http client that do short connection with youdao api endpoint.

# Interfaces

Audio word audio abstracion.