Skip to content

Commit

Permalink
Remove the corpus statistics code
Browse files Browse the repository at this point in the history
It is obsolete and unsupported.
Per discussion at PR opencog#971.
  • Loading branch information
ampli committed Jul 20, 2019
1 parent 0db61bb commit 5249ddb
Show file tree
Hide file tree
Showing 36 changed files with 10 additions and 1,720 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Version 5.7.0 (XXX 2019)
* Minor efficiency improvements to the SQL-backed dictionary.
* Incompatible change to the Exp traversal API.
* Remove the obsolete and unsupported "corpus statistics" code.

Version 5.6.2 (24 June 2019)
* Bug-fix the SQL-backed dictionary.
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ Contents
| ------------- |-------------|
| LICENSE | The license describing terms of use |
| link-grammar/*.c | The program. (Written in ANSI-C) |
| link-grammar/corpus/*.c | Optional corpus statistics database. |
| link-grammar/minisat/ | Optional SAT Solver. (Written in C++) |
| link-grammar/sat-solver/ | Optional SAT Solver. (Written in C++) |
| | |
Expand Down
4 changes: 0 additions & 4 deletions bindings/java-jni/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ liblink_grammar_java_la_LIBADD += ${MINISAT_LIBS}
endif !LIBMINISAT_BUNDLED
endif

if WITH_CORPUS
liblink_grammar_java_la_LIBADD += $(top_builddir)/link-grammar/corpus/liblink-corpus.la ${SQLITE3_LIBS}
endif

# Math libraries are needed for floorf, etc.
liblink_grammar_java_la_LIBADD += -lm

Expand Down
50 changes: 0 additions & 50 deletions bindings/java-jni/jni-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#endif /* HAVE_STDATOMIC_H */

#include "link-grammar/api-structures.h"
#include "link-grammar/corpus/corpus.h"
#include "link-grammar/error.h"
#include "jni-client.h"
#include "link-grammar/utilities.h"
Expand Down Expand Up @@ -479,55 +478,6 @@ Java_org_linkgrammar_LinkGrammar_getLinkageDisjunct(JNIEnv *env, jclass cls, jin
return j;
}

JNIEXPORT jstring JNICALL
Java_org_linkgrammar_LinkGrammar_getLinkageSense(JNIEnv *env,
jclass cls, jint i, jint j)
{
per_thread_data *ptd = get_ptd(env, cls);
Linkage lkg = ptd->linkage;
Sense *sns;
const char * w = NULL;
jstring js;

if (!lkg) return NULL;
lg_corpus_linkage_senses(lkg);
sns = lg_get_word_sense(lkg, i);
while ((0 < j) && sns)
{
sns = lg_sense_next(sns);
j--;
}

/* does not need to be freed, points into data structures */
if (sns) w = lg_sense_get_sense(sns);

if (w) js = (*env)->NewStringUTF(env, w);
else js = NULL;
return js;
}

JNIEXPORT jdouble JNICALL
Java_org_linkgrammar_LinkGrammar_getLinkageSenseScore(JNIEnv *env,
jclass cls, jint i, jint j)
{
per_thread_data *ptd = get_ptd(env, cls);
Linkage lkg = ptd->linkage;
Sense *sns;
double score = 0.0;

if (!lkg) return 0.0;
sns = lg_get_word_sense(lkg, i);
while ((0 < j) && sns)
{
sns = lg_sense_next(sns);
j--;
}

if (sns) score = lg_sense_get_score(sns);

return score;
}

/*
* Class: LinkGrammar
* Method: numSkippedWords
Expand Down
17 changes: 0 additions & 17 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -398,21 +398,6 @@ fi
AM_CONDITIONAL(LIBMINISAT_BUNDLED, test -n "$use_minisat_bundled_library")
AM_CONDITIONAL(WITH_SAT_SOLVER, test "x$enable_sat_solver" = xyes)

# ====================================================================
# Corpus stats disabled by default

AC_ARG_ENABLE( corpus-stats,
[ --enable-corpus-stats use corpus statistics],
[],
[enable_corpus_stats=no]
)
if test "x$enable_corpus_stats" = "xyes"
then
AC_DEFINE(USE_CORPUS, 1, [Define for compilation])
fi

AM_CONDITIONAL(WITH_CORPUS, test x${enable_corpus_stats} = xyes)

# ====================================================================

AC_ARG_ENABLE( wordgraph_display,
Expand Down Expand Up @@ -1021,7 +1006,6 @@ Makefile
link-grammar.pc
link-grammar.spec
link-grammar/Makefile
link-grammar/corpus/Makefile
link-grammar/minisat/Makefile
link-grammar/sat-solver/Makefile
link-grammar/link-features.h
Expand Down Expand Up @@ -1089,7 +1073,6 @@ $PACKAGE-$VERSION build configuration settings
HunSpell dictionary location: ${HunSpellDictDir}${HunSpellDictDir_status}
Boolean SAT parser: ${enable_sat_solver}${use_minisat_bundled_library}
SQLite-backed dictionary: ${SQLiteFound}
Corpus statistics database: ${enable_corpus_stats}
RegEx tokenizer: ${enable_regex_tokenizer}
Definitions: ${DEFS}
Libraries: ${lglibs}
Expand Down
143 changes: 0 additions & 143 deletions data/sql/README

This file was deleted.

10 changes: 0 additions & 10 deletions link-grammar/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ if WITH_SAT_SOLVER
SUBDIRS += $(MINISAT_DIR) sat-solver
endif

if WITH_CORPUS
SUBDIRS += corpus
endif

if OS_WIN32
install-libtool-import-lib:
$(INSTALL) .libs/liblink-grammar.dll.a $(DESTDIR)$(libdir)
Expand Down Expand Up @@ -82,10 +78,6 @@ liblink_grammar_la_LIBADD += ${MINISAT_LIBS}
endif !LIBMINISAT_BUNDLED
endif WITH_SAT_SOLVER

if WITH_CORPUS
liblink_grammar_la_LIBADD += $(top_builddir)/link-grammar/corpus/liblink-corpus.la ${SQLITE3_LIBS}
endif

# Math libraries are needed for floorf, etc.
liblink_grammar_la_LIBADD += -lm

Expand Down Expand Up @@ -126,7 +118,6 @@ liblink_grammar_la_SOURCES = \
post-process/pp_lexer.l \
post-process/pp_linkset.c \
prepare/build-disjuncts.c \
prepare/expand.c \
prepare/exprune.c \
print/print.c \
print/print-util.c \
Expand Down Expand Up @@ -186,7 +177,6 @@ liblink_grammar_la_SOURCES = \
post-process/pp_linkset.h \
post-process/pp-structures.h \
prepare/build-disjuncts.h \
prepare/expand.h \
prepare/exprune.h \
print/print.h \
print/print-util.h \
Expand Down
2 changes: 0 additions & 2 deletions link-grammar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ Listed in rough processing order.
* post-process - Constraint rules applied after parsing.
Also, rules for constituent-tree construction.

* corpus - word-sense disambiguation data from an SQL file.

* print - functions that convert parses into
human-readable strings and printed output.

Expand Down
1 change: 0 additions & 1 deletion link-grammar/api-structures.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@

#include "api-types.h"
#include "tracon-set.h"
#include "corpus/corpus.h"
#include "memory-pool.h"
#include "string-set.h"

Expand Down
4 changes: 0 additions & 4 deletions link-grammar/api-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ typedef struct pp_knowledge_s pp_knowledge;
typedef struct pp_linkset_s pp_linkset;
typedef struct PP_domains_s PP_domains;

typedef struct corpus_s Corpus;
typedef struct sense_s Sense;
typedef struct cluster_s Cluster;

typedef struct Wordgraph_pathpos_s Wordgraph_pathpos;

#endif
Loading

0 comments on commit 5249ddb

Please sign in to comment.