c++ - 编译 Charniak 的解析器

标签 c++ parsing compilation charniak-parser

几天前我下载了Charniak's parser来自网络。该解析器用于解析自然语言。

我一直在尝试编译它,但它不起作用。当我在解析器目录中并键入 make 时,会提示:

/usr/bin/g++  -c -O Bchart.C
/usr/bin/g++  -c -O BchartSm.C
/usr/bin/g++  -c -O Bst.C
/usr/bin/g++  -c -O FBinaryArray.C
/usr/bin/g++  -c -O CntxArray.C
/usr/bin/g++  -c -O ChartBase.C
/usr/bin/g++  -c -O ClassRule.C
/usr/bin/g++  -c -O ECArgs.C
/usr/bin/g++  -c -O Edge.C
/usr/bin/g++  -c -O EdgeHeap.C
/usr/bin/g++  -c -O Feat.C
/usr/bin/g++  -c -O Feature.C
/usr/bin/g++  -c -O FeatureTree.C
/usr/bin/g++  -c -O Field.C
/usr/bin/g++  -c -O FullHist.C
/usr/bin/g++  -c -O GotIter.C
/usr/bin/g++  -c -O InputTree.C
/usr/bin/g++  -c -O Item.C
/usr/bin/g++  -c -O Link.C
/usr/bin/g++  -c -O Params.C
/usr/bin/g++  -c -O ParseStats.C
/usr/bin/g++  -c -O SentRep.C
/usr/bin/g++  -c -O Term.C
/usr/bin/g++  -c -O TimeIt.C
/usr/bin/g++  -c -O UnitRules.C
/usr/bin/g++  -c -O ValHeap.C
/usr/bin/g++  -c -O edgeSubFns.C
/usr/bin/g++  -c -O ewDciTokStrm.C
/usr/bin/g++  -c -O extraMain.C
/usr/bin/g++  -c -O fhSubFns.C
/usr/bin/g++  -c -O headFinder.C
/usr/bin/g++  -c -O headFinderCh.C
cc    -c -o utils.o utils.c
In file included from utils.c:23:
utils.h:28:19: fstream: No such file or directory
utils.h:29:16: list: No such file or directory
In file included from utils.h:30,
                 from utils.c:23:
ECString.h:8: error: syntax error before "namespace"
ECString.h:8: warning: data definition has no type or storage class
In file included from utils.h:30,
                 from utils.c:23:
ECString.h:9:18: string: No such file or directory
In file included from utils.c:23:
utils.h:31:18: vector: No such file or directory
In file included from utils.c:23:
utils.h:37: error: syntax error before "intToString"
utils.h:37: warning: data definition has no type or storage class
utils.h:38: error: syntax error before '<' token
utils.h:39: error: syntax error before ':' token
utils.h:40: error: syntax error before "st"
utils.h:40: warning: data definition has no type or storage class
utils.h:43: error: syntax error before '&' token
utils.h:44: error: syntax error before "lastCharacter"
utils.h:44: error: syntax error before '&' token
utils.h:44: warning: data definition has no type or storage class
utils.h:45: error: syntax error before "firstCharacter"
utils.h:45: error: syntax error before '&' token
utils.h:45: warning: data definition has no type or storage class
utils.c:24:20: iostream: No such file or directory
utils.c: In function `error':
utils.c:34: error: `cerr' undeclared (first use in this function)
utils.c:34: error: (Each undeclared identifier is reported only once
utils.c:34: error: for each function it appears in.)
utils.c:34: error: `endl' undeclared (first use in this function)
utils.c: In function `warn':
utils.c:43: error: `cerr' undeclared (first use in this function)
utils.c:43: error: `endl' undeclared (first use in this function)
utils.c: At top level:
utils.c:47: error: syntax error before '&' token
utils.c: In function `ignoreComment':
utils.c:49: error: `string' undeclared (first use in this function)
utils.c:49: error: syntax error before "nxt"
utils.c:51: error: `inpt' undeclared (first use in this function)
utils.c:59: error: `nxt' undeclared (first use in this function)
utils.c: In function `toLower':
utils.c:82: error: 'for' loop initial declaration used outside C99 mode
utils.c: At top level:
utils.c:97: error: syntax error before "intToString"
utils.c: In function `intToString':
utils.c:101: error: `string' undeclared (first use in this function)
utils.c:101: error: syntax error before "ans"
utils.c:102: error: `ans' undeclared (first use in this function)
utils.c: At top level:
utils.c:106: error: syntax error before "vECfind"
utils.c:106: error: syntax error before "s"
utils.c: In function `vECfind':
utils.c:108: error: `ECStringsIter' undeclared (first use in this function)
utils.c:108: error: syntax error before "eci"
utils.c:109: error: `eci' undeclared (first use in this function)
utils.c:109: error: `sts' undeclared (first use in this function)
utils.c:109: error: `s' undeclared (first use in this function)
utils.c:109: error: `true' undeclared (first use in this function)
utils.c:110: error: `false' undeclared (first use in this function)
utils.c: At top level:
utils.c:113: error: syntax error before "lastCharacter"
utils.c:113: error: syntax error before '&' token
utils.c: In function `lastCharacter':
utils.c:115: error: `string' undeclared (first use in this function)
utils.c:115: error: syntax error before "f"
utils.c:116: error: `s' undeclared (first use in this function)
utils.c:121: error: `f' undeclared (first use in this function)
make: *** [utils.o] Error 1

其他一些人在编译这个东西时遇到问题,比如 this forum 中的那个.但我不认为我的 gcc 版本是问题所在。

注意:我正在尝试构建用于自然语言解析的数值优化算法。我正在尝试从 charniak 的解析器中获取一些示例。任何帮助将不胜感激。

最佳答案

这是布朗语言信息处理实验室的更新和改进版本: https://github.com/BLLIP/bllip-parser

我在 Ubuntu 12.10 上编译它,它很容易。您需要安装 Flex。

关于c++ - 编译 Charniak 的解析器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7287087/

相关文章:

c++ - 如何在 XCode 中指定 -D__MACOSX_CORE__

c++ - Visual Studio C++ 项目配置中的“调试”和“Unicode 调试”有什么区别?

javascript - JS - 解析\n 和其他对象到相关 HTML

Python 日期解析

vb.net - Visual Basic构建问题

linux - 如何在 64 位 mac 上从源代码安装 tcpslice,为 fedora 发布?

hadoop - 运行 pig 0.7.0 错误 : ERROR 2998: Unhandled internal error

c++ - 在 WinAPI 中使用资源名称

c++ - 如何将 int 转换为 LPCTSTR? Win32

java - 如何使用 Java 解析大型 XML 文件?