有没有 Maven 可用的 Java 库实现英汉词典功能的?

2018-09-03 00:47:13 +08:00
 xuanwu

如果没有, 在想封装这个词典数据: https://github.com/skywind3000/ECDICT#%E6%95%B0%E6%8D%AE%E6%A0%BC%E5%BC%8F 查词返回值初步设想示例如下. 还需改进数据结构(释义 /标签 /变形应是列表, 等等):

{英文: a
音标: ei
英文释义: n. the 1st letter of the Roman alphabetnn. the blood group whose red cells carry the A antigen
中文释义: 第一个字母 A; 一个; 第一的 rnart. [计] 累加器, 加法器, 地址, 振幅, 模拟, 区域, 面积, 汇编, 组件, 异步
词语位置: 
柯林斯星级: 5
为牛津三千核心词: 1
标签: zk gk
英国国家语料库词频顺序: 5
当代语料库词频顺序: 5
变形: 
详细: ""
在线读音音频: 
}

{英文: anamorphosis
音标: .ænә'mɒ:fәsis
英文释义: n. the evolution of one type of organism from another by a long series of gradual changesnn. a distorted projection or perspective; especially an image distorted in such a way that it becomes visible only when viewed in a special manner
中文释义: n. 歪像, 失真图像, 畸形发育, 渐变体 n[化] 变形; 失真
词语位置: 
柯林斯星级: 
为牛津三千核心词: 
英国国家语料库词频顺序: 0
当代语料库词频顺序: 0
变形: 
标签: 
详细: 
在线读音音频: 
}

{英文: collocate
音标: 'kɒlәkeit
英文释义: v. have a strong tendency to occur side by sidenv. group or chunk together in a certain order or place side by side
中文释义: vt. 布置, 使成搭配, 排列
词语位置: 
柯林斯星级: 
为牛津三千核心词: 
英国国家语料库词频顺序: 0
当代语料库词频顺序: 0
变形: s:collocates/3:collocates/i:collocating/p:collocated/d:collocated
标签: 
详细: 
在线读音音频: 
}
2072 次点击
所在节点    奇思妙想
4 条回复
xuanwu
2018-09-04 14:33:57 +08:00
初步实现, 变形部分有些改进:
```
{英文: collocate
音标: 'kɒlәkeit
英文释义: v. have a strong tendency to occur side by sidenv. group or chunk together in a certain order or place side by side
中文释义: vt. 布置, 使成搭配, 排列
词语位置:
柯林斯星级: 0
为牛津三千核心词: false
标签:
英国国家语料库词频顺序: 0
当代语料库词频顺序: 0
变形: 名词复数形式:collocates; 第三人称单数:collocates; 现在分词:collocating; 过去式:collocated; 过去分词:collocated;
详细:
在线读音音频:
}
```
接下去是释义部分的分隔, 比如:
```
{英文: anamorphosis
音标: .ænә'mɒ:fәsis
英文释义: n. the evolution of one type of organism from another by a long series of gradual changes\nn. a distorted projection or perspective; especially an image distorted in such a way that it becomes visible only when viewed in a special manner
中文释义: n. 歪像, 失真图像, 畸形发育, 渐变体\n[化] 变形; 失真
词语位置:
柯林斯星级: 0
为牛津三千核心词: false
标签:
英国国家语料库词频顺序: 0
当代语料库词频顺序: 0
变形:
详细:
在线读音音频:
}
```
linshuang
2018-09-06 09:28:33 +08:00
git clone 下来,自己打包 install 到本地仓库就好了
xuanwu
2018-09-06 14:35:30 +08:00
@linshuang 你是说用 ECDICT 下的 Python 脚本吗? 比如 https://github.com/skywind3000/ECDICT/blob/master/stardict.py ?
做这个的一个目的是用在 https://www.v2ex.com/t/484895#r_6131734, 而代码语法分析和生成的部分打算用 Java 做, 所以打算直接用 Java 封装一下英汉词典数据.
xuanwu
2018-09-06 15:47:23 +08:00
已发布:
<dependency>
<groupId>com.codeinchinese</groupId>
<artifactId>english-chinese-dictionary</artifactId>
<version>0.0.1</version>
</dependency>
源码库在: https://github.com/program-in-chinese/english-chinese-dictionary

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/485481

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX