90 个版本 (7 个稳定版)
3.16.0-beta.9 | 2023 年 8 月 27 日 |
---|---|
3.15.8 | 2023 年 6 月 25 日 |
3.15.4 | 2022 年 12 月 24 日 |
3.15.3-beta | 2022 年 7 月 31 日 |
0.1.0 | 2021 年 12 月 20 日 |
#35 in #parser-combinator
每月 185 次下载
8.5MB
9K SLoC
wordshk-tools
words.hk (粵典) 工具的组合。
解析器
/// Parse the whole words.hk CSV database into a [Dict]
pub fn parse_dict() -> Result<Dict, Box<dyn Error>>
位于 /src/lib.rs
解析所有标记为“OK”的条目,并将结果存储为条目列表。此解析器是该库的核心,因为它的输出被其他函数如 to_apple_dict
使用。为了提高效率,不使用正则表达式和回溯。它由一个名为 lip 的库提供支持,该库由我本人编写,提供灵活的解析器组合并支持友好的错误消息。
示例用法
- 解析 words.hk 字典并提取有用信息
- 有关更多详细信息,请参阅
examples/parse_dict
- 有关更多详细信息,请参阅
- 导出到 Apple 字典
- 有关更多详细信息,请参阅
examples/export_apple_dict
- 有关更多详细信息,请参阅
- 搜索 words.hk
- 有关更多详细信息,请参阅
examples/benchmark_search
- 有关更多详细信息,请参阅
源代码
可以从 words.hk 下载 words.hk 字典的完整最新 CSV 数据库。您可以通过此链接请求访问 CSV: https://words.hk/faiman/request_data/
许可证
MIT
依赖项
~17–32MB
~472K SLoC