Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alienkevin/wordshk-tools
Tools for processing open Cantonese dictionary data provided words.hk
https://github.com/alienkevin/wordshk-tools
cantonese-dictionary parser wordshk
Last synced: 2 months ago
JSON representation
Tools for processing open Cantonese dictionary data provided words.hk
- Host: GitHub
- URL: https://github.com/alienkevin/wordshk-tools
- Owner: AlienKevin
- Created: 2021-10-11T14:32:04.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-16T11:56:59.000Z (9 months ago)
- Last Synced: 2024-05-17T00:31:30.423Z (9 months ago)
- Topics: cantonese-dictionary, parser, wordshk
- Language: Rust
- Homepage: https://docs.rs/wordshk_tools/latest/wordshk_tools/
- Size: 109 MB
- Stars: 13
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wordshk-tools
A combination of tools for words.hk (粵典).
## Parser
```rust
/// Parse the whole words.hk CSV database into a [Dict]
pub fn parse_dict() -> Result>
```
Located at `/src/lib.rs`Parses all entries marked with OK and store the results as a list of entries. This parser is the very core of this library because its output is used by other functions like `to_apple_dict`.
To boost efficiency, no regular expressions and backtracking are used. It is powered by a library called [lip](https://github.com/AlienKevin/lip) (written by myself) that provides
flexible parser combinators and supports friendly error messages.## Example Usages
1. Parse words.hk dictionary and extract useful information
* See `examples/parse_dict` for more details
2. Export to Apple Dictionary
* See `examples/export_apple_dict` for more details
3. Search words.hk
* See `examples/benchmark_search` for more details## Source
The full up-to-date CSV database of words.hk dictionary can be downloaded from words.hk. You can request access to the CSV using this link: https://words.hk/faiman/request_data/
## License
MIT