V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
这是一个专门讨论 idea 的地方。

每个人的时间,资源是有限的,有的时候你或许能够想到很多 idea,但是由于现实的限制,却并不是所有的 idea 都能够成为现实。

那这个时候,不妨可以把那些 idea 分享出来,启发别人。
xuanwu
V2EX  ›  奇思妙想

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

  •  
  •   xuanwu · 2018-09-03 00:47:13 +08:00 · 2057 次点击
    这是一个创建于 2066 天前的主题,其中的信息可能已经有所发展或是发生改变。

    如果没有, 在想封装这个词典数据: 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
    标签: 
    详细: 
    在线读音音频: 
    }
    
    4 条回复    2018-09-06 15:47:23 +08:00
    xuanwu
        1
    xuanwu  
    OP
       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
        2
    linshuang  
       2018-09-06 09:28:33 +08:00
    git clone 下来,自己打包 install 到本地仓库就好了
    xuanwu
        3
    xuanwu  
    OP
       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
        4
    xuanwu  
    OP
       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
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2569 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 13:09 · PVG 21:09 · LAX 06:09 · JFK 09:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.