- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我正在浏览像 wordnet 这样的开放式词典的数据库大小它的数据库 大小接近52 MB
。但是我在 Google Play
上看到了一些离线词典应用程序,比如
1 : http://wordnet.princeton.edu/ English Dictionary使用维基词典数据库的应用程序。我不知道他们如何设法提供只有 15 MB
大小且超过 167000
个单词的离线词典?
在数据库中保存单词的方式可能是什么?
最佳答案
Wordnet 在较小的内存占用方面具有相当大的优势。
如何? - 这是简要图片:
words are stored into index files for fast search - index.noun, index.adj, etc.
relation between word and offset in definition file - data.noun, etc is provided.
each of line in definition file corresponds to one definition and relationships between words are marked by a symbol and offset. eg. ! for antonym, @ for kind of, etc.
This makes the whole thing pretty compact.
有关此内容的更多信息,请阅读:man 5 wndb
。
关于尺寸:52MB = 52000KB
对于 Wordnet 中大约 180K 的单词 - 每个单词有 52000K/180K ~ 300bytes。
平均约 300 个字节来表示定义 + 关系 - 足够好。例如(大约)平均每 4 个定义(20 个字符)、2 个用法(20 个字符)、关系开销(10 个关系)
关于database - 字典数据库大小——哪些算法和策略让它如此轻便?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22118062/
Flow Launcher Flow Launcher是一款.NET开源(MIT License)、免费、功能强大、方便实用的 Windows 文件搜索和应用程序启动器,能够帮助你快速查找文件、启动
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我是一名优秀的程序员,十分优秀!