Coder Social home page Coder Social logo

emacsmirror / youdao-dictionary Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xuchunyang/youdao-dictionary.el

0.0 4.0 0.0 63 KB

Youdao Dictionary interface for Emacs

Home Page: https://github.com/xuchunyang/youdao-dictionary.el

Emacs Lisp 100.00%

youdao-dictionary's Introduction

Youdao Dictionary interface for Emacs

http://melpa.org/packages/youdao-dictionary-badge.svg http://stable.melpa.org/packages/youdao-dictionary-badge.svg

youdao-dictionary is a simple Youdao Dictionary (有道词典) interface for Emacs.

Installation

Install youdao-dictionary from MELPA with:

M-x package-install RET youdao-dictionary RET

Setup

Youdao discontinued the free API earlier this year (2023), so this package is no longer ready to use out of the box. You will need to apply for an API on your own.

You can set your api key and secret in ~/.authinfo.gpg or ~/.authinfo, e.g,

machine openapi.youdao.com login 应用ID password 应用秘钥

Alternatively, you can set them in your config, e.g,

;; Change 应用ID and 应用秘钥 to yours
(setq youdao-dictionary-app-key "应用ID"
      youdao-dictionary-secret-key "应用秘钥")

Usage

youdao-dictionary-search-at-point
Search word at point and display result with buffer
youdao-dictionary-search-at-point+
Search word at point and display result with popup-tip
youdao-dictionary-search-at-point-tooltip
Search word at point and display result with tooltip
youdao-dictionary-search-at-point-posframe
Search word at point and display result with posframe
youdao-dictionary-search-from-input
Search word from input and display result with buffer
youdao-dictionary-search-and-replace
Search word at point and display result with popup-menu, replace word with selected translation.
youdao-dictionary-play-voice-at-point
Play voice of word at point (by @snyh)
youdao-dictionary-play-voice-from-input
Play voice of word from input (by @snyh)

Customization

youdao-dictionary-posframe-tip-face
Face for posframe buffer, defaut to inherit tooltip

Sample configuration

;; 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: A external Chinese word segmentation tool (e.g. 结巴分词) is needed to enable Chinese word segmentation support. For more info, see chinese-word-at-point.el#prerequisite.

Related tools

ydcv
YouDao Console Version in Python (youdao-dictionary.el is inspired by it)
fanyi
A translate tool in your command line (supports both Youdao and iciba)
go-translate
Powerful translator on Emacs. Supports multiple translation engines such as Google, Bing, deepL, StarDict, Youdao.
bing-dict
Minimalists’ English-Chinese Bing dictionary

youdao-dictionary's People

Contributors

et2010 avatar lujun9972 avatar seagle0128 avatar snyh avatar vritser avatar xiaogema avatar xuchunyang avatar yanghaoxie avatar yangsheng6810 avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.