youdao-dictionary
est une interface simple de dictionnaire Youdao (有道词典) pour Emacs.
Installez youdao-dictionary
depuis MELPA avec :
Mx package-install RET youdao-dictionary RET
Youdao a interrompu l'API gratuite plus tôt cette année (2023), ce package n'est donc plus prêt à être utilisé immédiatement. Vous devrez demander une API par vous-même.
Vous pouvez définir votre clé API et votre secret dans ~/.authinfo.gpg
ou ~/.authinfo
, par exemple :
machine openapi.youdao.com login 应用ID mot de passe 应用秘钥
Alternativement, vous pouvez les définir dans votre configuration, par exemple :
; ; Change 应用ID and 应用秘钥 to yours
( setq youdao-dictionary-app-key "应用ID "
youdao-dictionary-secret-key "应用秘钥" )
youdao-dictionary-search-at-point
youdao-dictionary-search-at-point+
youdao-dictionary-search-at-point-tooltip
youdao-dictionary-search-at-point-posframe
youdao-dictionary-search-from-input
youdao-dictionary-search-and-replace
youdao-dictionary-play-voice-at-point
youdao-dictionary-play-voice-from-input
youdao-dictionary-posframe-tip-face
tooltip
; ; Enable Cache
( setq url-automatic-caching t )
; ; Example Key binding
( global-set-key ( kbd " C-c y " ) 'youdao-dictionary-search-at-point )
; ; Integrate with popwin-el (https://github.com/m2ym/popwin-el)
; ; (push "*Youdao Dictionary*" popwin:special-display-config)
; ; Set file path for saving search history
; ; (setq youdao-dictionary-search-history-file "~/.emacs.d/.youdao")
; ; Enable Chinese word segmentation support (支持中文分词)
; ; (setq youdao-dictionary-use-chinese-word-segmentation t)
Notes : Un outil externe de segmentation de mots chinois (par exemple 结巴分词) est nécessaire pour activer la prise en charge de la segmentation de mots chinois. Pour plus d'informations, consultez Chinese-word-at-point.el#prerequisite.