indexing - 如何生成(书籍)索引?

标签 indexing

我需要为一本书创建一个索引。虽然乍一看这项任务很简单——按第一个字母对单词进行分组,然后对它们进行排序——但这个显而易见的解决方案仅适用于美国语言。然而,真正的词要复杂得多。参见 http://en.wikipedia.org/wiki/Collation :

The difference between computer-style numerical sorting and true alphabetical sorting becomes obvious in languages using an extended Latin alphabet. For example, the 29-letter alphabet of Spanish treats ñ as a basic letter following n, and formerly treated ch and ll as basic letters following c and l, respectively. Ch and ll are still considered letters, but are now alphabetized as two-letter combinations. (The new alphabetization rule was issued by the Royal Spanish Academy in 1994.) On the other hand, the digraph rr follows rqu as expected, both with and without the 1994 alphabetization rule. A numeric sort may order ñ incorrectly following z and treat ch as c + h, also incorrect when using pre-1994 alphabetization.

我试图找到一个现有的解决方案。

DocBook 样式表没有解决这个问题。

我找到的最佳匹配是 xindy ( http://xindy.sourceforge.net/ ),但是这个工具与 LaTeX 的联系太多了。

还有什么建议吗?

最佳答案

天真地,您可以检查文本中的每个单词并创建一个散列,使用这些单词作为键,并构建一个位置数组(页码?)作为值。

但索引通常比这更集中一些。

关于indexing - 如何生成(书籍)索引?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4397533/

相关文章:

database - 根据前缀在表中查找单词

python - 如何从 itertools.combinations 创建 numpy 数组而不循环

mysql - 索引总和列

algorithm - 跟踪/计算词频

c++ - 使用 MxN 矩阵获得意想不到的结果

python - 如何在第一次出现数字之前的最后一个字母处截断字符串?

elasticsearch - Elasticsearch 1.x添加时间戳的字段副本

java - 索引java矩阵

mysql - 我应该如何在一个非常大的表中使用索引

javascript - 是否有类似 Solr 或 Elasticsearch 的东西只能在 Javascript 中在客户端上使用?