3

I am trying to use Charniak Parser (not reranker) to parse a sentence. I mean I have a sentence like this:

It is good to meet you.

And I need it to be parsed by Charniak (I insist on using Charniak parser, because after that I am going to use LTH system and LTH works based on Charniak Parser).

So, the result would be something like:

(s (XP(PRP I) (V is) ....)

However, when I try to run "make" command for Charinak Parser, I face these errors:

BChartsm.c LeftRightGotIter does not name a type
BChartsm.c in member function double Bchart::pHypgt(const std::string&, int)
BChartsm.c strpbrk was not declared in this scope
BChartsm.c in member function float Bchart::coputeTgT(int,int)
BChartsm.c globalGi was not declared in this scope

I tried to use a patch developed by Madnani, but it did not work for me. Also I tried to use this solution, but I couldn't understand the last part. I ran all the sudo dpkg ... codes, but after that I didn't understand what I should do.

Meanwhile, I would say that I'm using Ubuntu 11.04 and my OS is a 64bit one.

Can anyone explain to me how I can solve the problems?

4

2 回答 2

3

您正在编译 C++ 代码,并且它以某种方式驻留在“.c”文件中。GCC 将它们视为 C 源代码,而不是 C++。

您必须使用 GCC 的“-x”选项强制识别 C++ 源代码。

gcc -x c++  <your_source>

由于您在谈论 Makefile,请查找 CFLAGS 选项并在-x c++此处添加该选项。

于 2012-07-26T08:23:04.877 回答
3

从 Charniak 的页面和 Brown 网站链接的版本尚未得到维护。让它与最新的 g++ 一起工作需要相当多的工作。

幸运的是,布朗(BLLIP)确实在 GitHub 上以“BLLIP Parser”的名义维护了一个版本:

https://github.com/BLLIP/bllip-parser

这是我第一次使用 64 位 Ubuntu 编译。请注意,如果您还没有 Flex,您还需要安装它。

于 2013-06-13T22:13:38.353 回答