在文本中搜索25 000个词 [英] search 25 000 words within a text
本文介绍了在文本中搜索25 000个词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在一个文本中找到〜25 000个字的出现。
I need to find occurrences of ~ 25 000 words within a text. What is the most suitable algorithm/library for this purpose?
目标语言是C ++
推荐答案
使用单词构建一个哈希表,并扫描throuhgt文本,为wordtable中的每个单词查找填充所需的信息(增量计数,添加到位置列表,无论什么)。
build a hashtable with the words, and scan throuhgt the text, for each word lookup in the wordtable and stuff the needed info (increment count, add to a position list, whatever).
这篇关于在文本中搜索25 000个词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文