处理大型同义词列表的最佳方法 [英] best way to handle large synonyms list

查看:84
本文介绍了处理大型同义词列表的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将为要在免费的Microsoft单词中使用的英语单词制作一个非常大的同义词列表.

我想知道什么是处理此类数据的最佳方法?文本文档的大小最大为12 mb.

我有两个问题:
1.)列表不应保存在文本文件之类的外部文件中,而必须驻留在程序本身(单独的类文件)中.
2.)IAM制造一个文字处理器,所以我希望用户查看所选单词的同义词.

存储带有同义词的单词,然后从列表中检索任何选定单词的同义词的最佳方法是什么?

例如:word1-同义词1. synonym2等
word2-同义词1. synonym2等
word2-同义词1. synonym2等

i am going to make a very large list of synonyms for english words to be used in a free microsoft word.

i wanted to know what would be thw best way to handle such a data?? the text document size goes upto 12 mb.

I have two problems :
1.) the list should not be saved in an external file like a text document and must reside inside the program itself (a separate class file).
2.) iam making a word processor so i want the user to view synonyms for a selected word.

what would be the best way to store the words with their synonyms and then retrieve the synonyms for any selected word from the list?

eg : word1 - synonym1. synonym2, etc
word2 - synonym1. synonym2, etc
word2 - synonym1. synonym2, etc

but which collection type would be best suited for this operation?

推荐答案

我希望字典是唯一的选择,每个单词都指向单词列表.我希望使用每个单词的ID来存储它,因此,至少在创建列表的代码中,您不会一遍又一遍地出现相同的单词.

实际上,这是唯一有意义的集合,也许您需要先阅读一些内容,以便了解存在的不同类型的容器,它们的工作方式,它们的优点等等?
I would expect a dictionary is the only choice here, with each word pointing to a list of words. I''d expect to store this using ids for each word, so you don''t have the same words appearing over and over again, at least in the code that creates the list.

This is in fact the only collection that makes any sense at all, perhaps you need to do some reading first so you understand the different types of containers that exist, how they work, what their strengths are, etc ?


这篇关于处理大型同义词列表的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆