什么是排列索引?
我正在阅读《加速 C++》。我不明白练习 5-1:
设计并实现一个程序,根据以下输入生成排列索引。置换索引是指每个短语都由短语中的每个单词进行索引的索引。
The quick brown fox jumped over the fence The quick brown fox jumped over the fence jumped over the fence The quick brown fox jumped over the fence The quick brown fox
这个解释我不清楚。置换索引到底是什么?
I am reading Accelerated C++. I don't understand Exercise 5-1:
Design and implement a program to produce a permuted index from the following input. A permuted index is one in which each phrase is indexed by every word in the phrase.
The quick brown fox jumped over the fence The quick brown fox jumped over the fence jumped over the fence The quick brown fox jumped over the fence The quick brown fox
That explanation isn't clear to me. What exactly is a permuted index?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
来自:http://en.wikipedia.org/wiki/Key_Word_in_Context
ps:可以访问wikipedia通过 http://www.proxify.com
From: http://en.wikipedia.org/wiki/Key_Word_in_Context
ps: you can access wikipedia via http://www.proxify.com
您可以在7th UNIX™ 程序员参考手册版本,第 1 卷(可追溯到 1979 年)。它的一个片段(来自 PDF 文件)是:
如果您查找“帐户”,您可以找到多个相关条目。您可能不会想到寻找
sa(1)
以及ac(1)
,更不用说acct(2)
或acct(5)
除非它们组合在一起。这就是排列索引的好处;您可以查找关键字并在更大的上下文中查看它。您还可以查看同一第 7 版手册中的
ptx(1)
命令的手册页条目。You can find a 'live' example of a permuted index in the 7th Edition UNIX™ Programmer's Reference Manual, Vol 1 (dating back to 1979). A fragment of it (from the PDF files) is:
If you look for 'account', you can find a number of related entries together. You probably wouldn't think to look for
sa(1)
as well asac(1)
, not to mentionacct(2)
oracct(5)
unless they were grouped together. This is the benefit of a permuted index; you can look up the key word and see it in a bigger context.You could also look at the man page entry for the
ptx(1)
command in the same 7th Edition manual.置换索引是由其上下文包围的按字母顺序排列的索引列表。在输出中,观察粗体字。它们按字母顺序排序,并被其上下文包围。这使我们可以轻松搜索单词并直接从周围上下文(即您案例中的单词)推断其用法。
敏捷的棕色狐狸
跳过了栅栏
敏捷的棕色狐狸
跳过了栅栏
跳过了< /strong> 栅栏
敏捷 棕色狐狸
跳过栅栏 栅栏
敏捷 棕色狐狸
Permuted index is an alphabetic list of index surrounded by its context. In the output, observe the bold words. They are alphabetically sorted and are surrounded by its context. This makes it easy for us to search a word and directly infer its usage from the surrounding context i.e. words in your case.
The quick brown fox
jumped over the fence
The quick brown fox
jumped over the fence
jumped over the fence
The quick brown fox
jumped over the fence
The quick brown fox