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?

lejlot
  • 64,777
  • 8
  • 131
  • 164
user1419243
  • 1,655
  • 3
  • 19
  • 33

2 Answers2

3

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.

Viktor Latypov
  • 14,289
  • 3
  • 40
  • 55
3

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.

winwaed
  • 7,645
  • 6
  • 36
  • 81