https://github.com/brookhong/sqlitedictbuilder
A python script to build dictionary for Dictorium.
https://github.com/brookhong/sqlitedictbuilder
Last synced: about 2 months ago
JSON representation
A python script to build dictionary for Dictorium.
- Host: GitHub
- URL: https://github.com/brookhong/sqlitedictbuilder
- Owner: brookhong
- Created: 2020-06-13T11:59:09.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-13T13:05:44.000Z (almost 5 years ago)
- Last Synced: 2025-03-19T07:01:55.373Z (about 2 months ago)
- Language: CSS
- Homepage:
- Size: 125 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A python script to build dictionary for Dictorium.
The input_file is a plain text file, each item is described in three lines. The 1st line of which is the key of the item, the 2nd is the value, and the 3rd is a delimiter line as `>`. Please see [test.txt](https://github.com/brookhong/SqliteDictBuilder/blob/master/tstdata/test.txt) for example.
The out_file is a sqlite file, you could use sqlite3 cli to check its schema.
## Usage
usage: gen-dict [-h] [--resource_dir RESOURCE_DIR] [--patch PATCH] [--dryrun]
input_file output_filegenerate sqlite3 dict
positional arguments:
input_file input text file
output_file file name for generated dboptional arguments:
-h, --help show this help message and exit
--resource_dir RESOURCE_DIR
resource files in the dir will be inserted into the db
--patch PATCH specify the keyword for which to patch
--dryrun test the command line## examples
* build dictionary `test.db` from `test.txt`
cd tstdata/
python ../gen-dict.py test.txt test.db --resource_dir res* patch dictionary `test.db` by replacing a resource file `res/js/main.js`
cd tstdata/
python ../gen-dict.py test.txt test.db --resource_dir res --patch res/js/main.js### Verify the test.db
1. install Brook's Chromium build.
2. access `dictorium://query/the` with the Chromium.