From 97416b96f6407c49f583a3aa579c9857b3d3d108 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 6 Dec 1995 16:06:42 +0000 Subject: [PATCH] Better diagnostics. Work on 'real' dictionary deletion. --- index/extract.c | 10 +++++++--- index/kinput.c | 23 +++++++++++++++++++---- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/index/extract.c b/index/extract.c index d0a615f..4426e4a 100644 --- a/index/extract.c +++ b/index/extract.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: extract.c,v $ - * Revision 1.40 1995-12-05 16:57:40 adam + * Revision 1.41 1995-12-06 16:06:42 adam + * Better diagnostics. Work on 'real' dictionary deletion. + * + * Revision 1.40 1995/12/05 16:57:40 adam * More work on regular patterns. * * Revision 1.39 1995/12/05 13:20:18 adam @@ -789,7 +792,8 @@ static int recordExtract (SYSNO *sysno, const char *fname, { if (!delkeys.buf_used) { - logf (LOG_WARN, "cannot delete %s - no delete keys", fname); + logf (LOG_WARN, "cannot delete %s: storeKeys false", + fname); } else { @@ -806,7 +810,7 @@ static int recordExtract (SYSNO *sysno, const char *fname, { if (!delkeys.buf_used) { - logf (LOG_WARN, "cannot update %s - no delete keys", + logf (LOG_WARN, "cannot update %s: storeKeys false", fname); } else diff --git a/index/kinput.c b/index/kinput.c index dd7583e..e152c75 100644 --- a/index/kinput.c +++ b/index/kinput.c @@ -4,7 +4,10 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: kinput.c,v $ - * Revision 1.10 1995-12-06 12:41:22 adam + * Revision 1.11 1995-12-06 16:06:43 adam + * Better diagnostics. Work on 'real' dictionary deletion. + * + * Revision 1.10 1995/12/06 12:41:22 adam * New command 'stat' for the index program. * Filenames can be read from stdin by specifying '-'. * Bug fix/enhancement of the transformation from terms to regular @@ -58,6 +61,7 @@ static int no_diffs = 0; static int no_updates = 0; +static int no_deletions = 0; static int no_insertions = 0; static int no_iterations = 0; @@ -349,11 +353,21 @@ int heap_inp (Dict dict, ISAM isam, struct heap_info *hi) { ISAM_P isam_p, isam_p2; logf (LOG_DEBUG, "updating %s", cur_name); - no_updates++; memcpy (&isam_p, info+1, sizeof(ISAM_P)); isam_p2 = is_merge (isam, isam_p, nmemb, key_buf); - if (isam_p2 != isam_p) - dict_insert (dict, cur_name, sizeof(ISAM_P), &isam_p2); +#if 0 + if (!isam_p2) + { + no_deletions++; + dict_delete (dict, cur_name); + } + else +#endif + { + no_updates++; + if (isam_p2 != isam_p) + dict_insert (dict, cur_name, sizeof(ISAM_P), &isam_p2); + } } else { @@ -409,6 +423,7 @@ void key_input (const char *dict_fname, const char *isam_fname, logf (LOG_LOG, "Iterations . . .%7d", no_iterations); logf (LOG_LOG, "Distinct words .%7d", no_diffs); logf (LOG_LOG, "Updates. . . . .%7d", no_updates); + logf (LOG_LOG, "Deletions. . . .%7d", no_deletions); logf (LOG_LOG, "Insertions . . .%7d", no_insertions); } -- 1.7.10.4