dict @ 65fd7bc9218f1bb0b4a5dd8d8141239b3211e1cd

 1# Iterative dictionary
 2
 3The goal is to provide a frictionless dictionary searching experience: you type
 4and the words show up on your prompt. Not need to wait a http request to go
 5through.
 6
 7As of right now, dict just provides a thin layer on top of sqlite's fts5[^1]
 8virtual table with support of spellfix[^2] for word suggestion. 
 9
10The whole database is loaded in memory for faster search and import process,
11which means that this application will consume substantial amounts of memory.
12On DE-EN dictionary, for example, it uses ~300MB, more then dict.cc tab on
13firefox (but less the most electron application out there)
14
15# Compiling
16
17You will need go, gcc and sqlite-dev, then you can just run
18
19```sh
20make
21```
22
23For development you can run:
24
25```sh
26make run     # run the ui with default values
27make import  # run the importer with default values
28make version # run the version command
29```
30
31# Installing
32
33To install locally you may run:
34
35```sh
36PREFIX=$(HOME)/.local make install
37```
38
39Or for a system wide istall:
40
41```sh
42sudo make install
43```
44
45# Usage
46
47To run the importer you will need to download dict.cc dictionary.
48First go to its request page[^3] and select your dictionary of choice.
49Once you download and unzip run the following command:
50
51```sh
52dict import --input dict.txt --output main.dict
53```
54
55Once the import process is complete[4] you can run the ui.
56
57```sh
58dict ui --database main.dict
59```
60
61# TODO
62
63- On disk operation: to reduce memory footprint we can read from the disk. We
64  would need to remove the instance response, since that is not possible
65  reading from the disk.
66- Better coloring on the list.
67- Better default path for sqlite database making use of XDG variables.
68- [optional] Multi dictionary support. Support more than one dict at once.
69- Async response. Even though in memory is fast enough most often it can have
70  some hiccups with 2 letter queries. 
71- Finish server
72- Alpine package
73
74
75[^1]: https://sqlite.org/fts5.html
76[^2]: https://www.sqlite.org/spellfix1.html
77[^3]: https://www1.dict.cc/translation_file_request.php
78[4]: It may take some time depending the size of the dictionary you selected