0

在阅读本文时,我遇到了“符号表”一词。起初,我以为这只是字典的另一个词,但我越来越不确定,因为我尝试实现论文中描述的差异算法。

我已经在互联网上搜索了一个可以理解的解释,但我没有找到答案。

有人可以解释论文中符号表的含义,并可能在 Python 中提供它的基本实现(数据结构,而不是算法)吗?论文中的相关描述在标题3“算法”中

John Resig (@john-resig)在 JavaScript 中提供了算法的实现,但我对 JavaScript 的熟练程度太有限,无法使用他的实现来了解数据结构。

4

1 回答 1

2

A "symbol table" is just what the name implies, a table of symbols. It's often implemented as an associative table, like a Python dictionary. Symbol tables are common in e.g. compilers, where you have to map things like variable and function names to their internal structures.

In relation to the paper you link to, the symbol table (dictionary) is indexed by the text of a line, and the data of each index is a pair of counters.

于 2012-07-24T09:58:31.727 回答