opencog / link-grammar

The CMU Link Grammar natural language parser
GNU Lesser General Public License v2.1
389 stars 119 forks source link

Corpus Statistics don't work #292

Closed karandeep-johar closed 5 years ago

karandeep-johar commented 8 years ago

I followed the instructions on the page which asks to run ./configure --enable-corpus-stats and then make which gives me the errors.

corpus.c: At top level:
corpus.c:249:22: error: unknown type name 'Linage'
 void lg_corpus_score(Linage lkg)
                      ^
corpus.c:288:8: error: conflicting types for 'lg_corpus_disjunct_score'
 double lg_corpus_disjunct_score(Linkage linkage, int w)
        ^
In file included from corpus.c:15:0:
corpus.h:24:8: note: previous declaration of 'lg_corpus_disjunct_score' was here
 double lg_corpus_disjunct_score(Linkage, WordIdx);
        ^
corpus.c: In function 'lg_corpus_disjunct_score':
corpus.c:305:16: error: dereferencing pointer to incomplete type
  infword = disj->string;

I tried to remove them by including the prerequisite files and also by changing the definition of double lg_corpus_disjunct_score(Linkage linkage, int w) to double lg_corpus_disjunct_score(Linkage linkage, WordIdx w).

I managed to compile it. But when I tried to run it. I got a seg fault. Can you please look into the issue?

linas commented 8 years ago

I'll look into this, but that code is old and discouraged: the last time the corpus dataset was built was maybe 8 years ago, and that dataset no longer matches the current dictionaries, and is unlikely to yield accurate rankings. Of course, you could build a new dataset, but this would take a lot of work, and the results might not be worth the effort. If you want to do research, then yes, do this, and I would encourage that. If you merely want to use it for something, then ... no.

linas commented 8 years ago

Flip-side is that a regenerated database might help with opencog issues, for example, opencog/opencog#2193 -- parse ranking of "Bob lives in China" (although that issue is worked around in commit 6780d33c45653551f582600bb57272416b4dbae6 )

ampli commented 5 years ago

Closing, as this code has been removed (from 5.7.0).