gpt4 book ai didi

database - 字典数据库大小——哪些算法和策略让它如此轻便?

转载 作者:搜寻专家 更新时间:2023-10-30 20:40:34 25 4
gpt4 key购买 nike

我正在浏览像 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com