计算机应用 ›› 2016, Vol. 36 ›› Issue (3): 833-836.DOI: 10.11772/j.issn.1001-9081.2016.03.833

• 行业与领域应用 • 上一篇    下一篇

LaTeX数学表达式解析与索引方法

周南, 田学东   

  1. 河北大学 计算机科学与技术学院, 河北 保定 071002
  • 收稿日期:2015-08-16 修回日期:2015-10-02 出版日期:2016-03-10 发布日期:2016-03-17
  • 通讯作者: 田学东
  • 作者简介:周南(1991-),男,河北承德人,硕士研究生,主要研究方向:信息检索;田学东(1963-),男,天津人,教授,博士,CCF会员,主要研究方向:模式识别、信息检索。
  • 基金资助:
    国家自然科学基金资助项目(61375075);河北省自然科学基金资助项目(F2012201020,F2013201134)。

Analyzing and indexing method on LaTeX formulae

ZHOU Nan, TIAN Xuedong   

  1. School of Computer Science and Technology, Hebei University, Baoding Hebei, 071002, China
  • Received:2015-08-16 Revised:2015-10-02 Online:2016-03-10 Published:2016-03-17
  • Supported by:
    This work is partially supported by the National Natural Science Foundation of China (61375075), the Natural Science Foundation of Hebei Province (F2012201020, F2013201134).

摘要: 针对数学表达式复杂二维结构特性所导致的普通文本检索技术难以对其进行检索的问题,提出了一种面向数学检索的LaTeX数学表达式解析与索引方法。在充分考虑公式特点的基础上,通过对LaTeX构成特点的分析和归纳,设计了LaTeX数学表达式的解析和检索特征提取算法;以此为基础,构建了一种适应数学表达式特性的双层索引结构,利用所提取数学表达式各层次运算数和运算符信息,分别以Treap数据结构和倒排索引结构构成数学表达式索引,为实现进一步的数学表达式检索匹配打下基础。在浏览器/服务器模式下采用6234条数学教材中的公式作为数据集进行实验,在解析获得的124960个基线层数最高为11层的表达式节点上,建立索引平均耗时为33.8317 s。实验结果表明所提出的LaTeX表达式解析算法和索引结构能够适应数学表达式的特点,有助于实现具有较高效率和准确性的数学表达式检索。

关键词: 数学表达式, LaTeX, 公式解析, 公式索引, 公式基线层次, Treap

Abstract: Focused on the topic that the ordinary full-text searching technology could not realize mathematical expression retrieval resulted from the complex two-dimensional structure characteristics of formulae, a method of LaTeX formulae analyzing and indexing was proposed. On the basis of the fully consideration of formulae' characteristics and the structure of LaTeX language, a parsing algorithm was designed for analyzing LaTeX expressions and extracting their retrieval features. Taking it as a foundation, a hierarchical index model was designed which employed the information of operands and operators extracted from mathematical expressions through the parsing algorithm. The index model has two layers, Treap data structure layer and inverted index layer, which laid the foundation of the retrieval and matching to formulae. The experiment was carried out under the mode of browser/server through taking 6234 formulae from mathematical textbooks as data set. The parsing algorithm gets 124960 expression nodes from resource formulae of which the highest baseline level is 11. The average time consumed of the index system is 33.8317 seconds. The experimental results show the proposed parsing algorithm and the index method are helpful for realizing mathematical expression retrieval with high efficiency and correctness.

Key words: mathematical expression, LaTeX, formula analysis, formula index, formula baseline, Treap

中图分类号: