简体   繁体   中英

Charniak Parser Errors

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?

You are compiling C++ code and somehow it resides in ".c" files. GCC treats them as C source, not C++.

You have to force recognition of C++ source by using "-x" option of GCC.

gcc -x c++  <your_source>

Since you are talking about Makefiles, look for CFLAGS option and add the -x c++ option there.

The version linked from both Charniak's page and the Brown site has not been maintained. It needs quite a bit of work to get it to work with the latest g++.

Luckily Brown (BLLIP) do keep a maintained version on GitHub under the name of "BLLIP Parser":

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

This compiled first time for me with 64 bit Ubuntu. Note that you will also need to install Flex if you do not already have it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM