Skip to content

lujun9972/anki-vocabulary.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 

Repository files navigation

README

Customization

anki-vocabulary-deck-name
Specify the Deck used to store the vocabulary card
anki-vocabulary-model-name
Specify the model of vocabulary card
anki-vocabulary-field-alist
Specify the meaning of fields in the model
expression
the vocabulary
sentence
the context of vocabulary
sentence_bold
the context with vocabulary bold
translation
translated context
glossary
meaning of vocabulary
phonetic
the phonetic symbol
M-x anki-vocabulary-set-ankiconnect
Help you settle arguments above

Usage

  1. Select the sentence in which the word is in as the context.
    • If the buffer mode is pdf-view-mode, you have to mark the context manually.
    • In other modes, It gets context by sentence-at-point and (thing-at-point 'line).
  2. M-x anki-vocabulary
  3. Pick the vocabulary

    It will display the translation of context(if avaible) and shows you vocabulary meanings

  4. Pick the correct meaning in the context

    It will create the card automatically

Specify the original language and target language

Using Youdao Service

This package use Youdao API (thanks to youdao-dictionary.el) to do the translation.

According to the API Documentation,It will identify Chinese, English, Japanese, Korean, French, Spanish, Portuguese, Russian, Vietnamese, German, Arabic, Indonesian and Italian automatically.

But you can also Specify the original language and target language with following steps.

  1. you should register a Youdao account and create an application to get an appKey and a secret-key (see the guide(in Chinese)).
  2. set the youdao-dictionary-app-key to the value of appKey
  3. set the youdao-dictionary-secret-key to the value of secret-key
  4. set the youdao-dictionary-from to the code of original language
  5. set the youdao-dictionary-to to the code of target language
The languagecode
Chinesezh-CHS
Englishen
Japaneseja
Koreanko
Frenchfr
SpanishEs
Portuguesept
Italianit
Russianru
Vietnamesevi
GermanDE
Arabicar
Indonesianid
Afrikaansaf
Bosnianbs
Bulgarianbg
Cantonesemake
Catalanca
Croatianhr
Czechcs
Danishda
Dutchnl
Estonianet
Fijianfj
Finnishfi
Greekel
HaitianCreole ht
Hebrewhe
Hindihi
White hmongmwW
Hungarianhu
Swahilisw
Klingontlh
Latvianlv
Lithuanianlt
Malayms
Maltesemt
Norwegianno
Persianfa
Polishpl
Queretarootq
Romanianro
Serbian (Cyrillic)sr-Cyrl
Serbian (Latin)sr-Latn
Slovaksk
Sloveniansl
Swedishsv
Tahitianty
Thaith
Tonganto
Turkishtr
Ukrainianuk
Urduur
Welshcy
Yucatan Mayayua
Albaniansq
Amharicam
Armenianhy
azeriaz
Bengalibn
Basqueeu
Belarusianbe
Cebu languageceb
Corsicanco
Esperantoeo
Filipinotl
Frisianfy
Galiciangl
Georgianka
Gujaratgu
Hausaha
Hawaiianhaw
Icelandicis
Iboig
Irishga
Javanesejw
Kannadakn
Kazakhkk
Khmerkm
Kurdishku
Kirgizky
Laolo
Latinla
Luxembourglb
Macedonianmk
Malgashmg
Malayalamml
Maorimi
Marathimr
Mongolianmn
Burmesemy
Nepaline
Zichewany
Pashtops
Punjabipa
Samoansm
Scottish Gaelicgd
The sesotho languagest
Shonasn
Sindhisd
Sinhalasi
Somaliso
The sundasu
Tajiktg
Tamilta
teluguTe
Uzbekuz
Xhosaxh
Yiddishyi
yorubayo
South African zuluzu
Automatic identificationauto

For example, if you want to translate French to English, you can do the following customization:

(setq youdao-dictionary-app-key "xxxxxxxxxxxxxxx")
(setq youdao-dictionary-secret-key "yyyyyyyyyyyyyyy")
(setq youdao-dictionary-from "fr")
(setq youdao-dictionary-to "en")
;;. Bonjour, je m’appelle Geo et je viens de Chine.

demo1.gif

Using other translation services

You can define your own function to fetch the meanings of vocabulary and translation of the context.

The function used to get meanings of vocabulary should accept the vocabulary as the argument and return an alist like

`((expression . ,vocabulary-string)
  (glossary . ,meanings-of-vocabulary-list)
  (phonetic . ,phonetic-string))"

The function used to translate the context should accept the context as the only argument and return the translation in a string.

Then set the anki-vocabulary-word-searcher to the function that get meanings of vocabulary.

Set the anki-vocabulary-sentence-translator to the function that get the translation of context.

About

Help you to create vocabulary card in Anki

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages