Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oozaku/dict
Dictionary cli
https://github.com/oozaku/dict
anki dictionary
Last synced: 6 days ago
JSON representation
Dictionary cli
- Host: GitHub
- URL: https://github.com/oozaku/dict
- Owner: Oozaku
- License: mit
- Created: 2022-05-30T19:35:22.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-06-30T22:16:07.000Z (over 2 years ago)
- Last Synced: 2024-10-10T12:44:41.371Z (27 days ago)
- Topics: anki, dictionary
- Language: Go
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dictionary
## About
This project is a dictionary/language learner tool that will let you search
for meaning/translation of words and it will save the results inside a file,
making it easy to import inside a ANKI deck.Special thanks to [Free Dictionary API](https://dictionaryapi.dev/) and
[OwlbotAPI](https://owlbot.info/) for providing free APIs and then making this
project possible.## Dependencies
- [go](https://go.dev/doc/install)
## Install
Make sure that GOPATH is in your path and run the following command.
~~~bash
go install github.com/Oozaku/dict@latest
~~~If you don't have the GOPATH, run `go env | grep GOPATH` and copy and paste the
value inside double quotes to your PATH.## Before Usage
To use this program, you need to set the configuration file at
`~/.config/dict/dict.json`. The code snippet bellow shows an example:~~~json
{
"anki-media-folder": "/home/oozaku/.local/share/Anki2/User 1/collection.media",
"anki-csv-location": "/home/oozaku/Documents/anki/anki.csv",
"dictionaries": ["owlbot", "dictionaryapi"],
"owlbot": {
"token": ""
}
}
~~~The field `anki-media-folder` is where Anki saves all medias used in your decks
and `anki-csv-location` is the file location that you will use later to import
to Anki.The Anki's media folder is a little trick to find, you have to find where
`collection.media` is located. On Linux, it probably is at
`~/.local/share/Anki2//collection.media`.`dictionaries` specifies which dictionaries you want to use and the sequence
given defines which dictionaries to look up first until find a result.`token` inside `owlbot` holds the API token to Owlbot API and you can get
[here](https://owlbot.info/).## Usage
Run `dict` at your terminal and then you can search for expressions in the
configured API. Anki's import file and all audios are saved automatically inside
the configured locations.To import the searched words into Anki, open Anki and go to File > Import...,
select your import file and set the first field as front and the second field as
back.One important note is that when Anki finds two entries with same name, it
overwrites the old one with the new one. So it's important that you import
inside a new deck to avoid overwritting you existing cards.## TO DO
- Features
- [x] Integrate an API
- [x] Save textual results in a supported format to Anki
- [x] Download audios
- [x] Save audio results inside file to be imported in Anki
- [x] Define configuration file
- [x] Create interface to abstract each API client
- [x] Lookup in each API until find answer
- [ ] Improve cli/tui
- [ ] Lookup firstly at memory, if not found, search in API
- Documentation:
- Improve README.md:
- [x] Add instructions on how to build/install
- [ ] Add documentation about how it works
- Code:
- [ ] Add comments