大文件索引问题!
同志们好:
我现在手头有个大文件索引问题,问问大家,没有什么太好的思路,同志们能否点提示!
file1:
Sentence1
collocation1 collocation2 collocation3 ......
Sentence2
collocation1 collocation2 collocation3 ......
.
.
.
file2
Sentence1
collocation1 collocation2 collocation3 ......
Sentence2
collocation1 collocation2 collocation3 ......
.
.
.
.
.
.
一共900多个file,每个300M,每个文件的格式如上所示,每个句子对应很多的collocation,这些collocation有重复的!
我现在想做的是:给我一些collocation我输出对应的Sentence!
我现在初步的想法是把collocation存到一个Hashtable中,取出collocation对应的ID和sentence的ID存到一个 CoOccurrence(我自己的类----计算两个ID共同出现的次数),但我现在的问题是,我把这些做好后存到硬盘中在去读的时候通过 Sentence的ID在去找句子(一个一个文件去找)的时候应该非常慢,同志们有好的思路和办法没??