# Copyright (C) 1994, Index Data I/S
# All rights reserved.
# Sebastian Hammer, Adam Dickmeiss
-# $Id: Makefile,v 1.10 1994-09-22 10:43:43 adam Exp $
+# $Id: Makefile,v 1.11 1994-09-26 10:17:23 adam Exp $
SHELL=/bin/sh
INCLUDE=-I../include
TPROG1=dicttest
TPROG2=dictext
-CFLAGS=-g -Wall -pedantic
+CFLAGS=-g -Wall -pedantic
DEFS=$(INCLUDE)
LIB=../lib/dict.a
PO = dopen.o dclose.o drdwr.o open.o close.o insert.o lookup.o lookupec.o
all: $(LIB)
$(TPROG1): $(TPROG1).o $(LIB)
- $(CC) $(CFLAGS) -o $(TPROG1) $(TPROG1).o $(LIB) ../lib/bfile.a ../lib/util.a
+ $(CC) $(CFLAGS) -o $(TPROG1) $(TPROG1).o $(LIB) ../lib/bfile.a ../lib/dfa.a ../lib/util.a
$(TPROG2): $(TPROG2).o $(LIB)
$(CC) $(CFLAGS) -o $(TPROG2) $(TPROG2).o ../lib/util.a
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: dicttest.c,v $
- * Revision 1.9 1994-09-22 14:43:56 adam
+ * Revision 1.10 1994-09-26 10:17:24 adam
+ * Minor changes.
+ *
+ * Revision 1.9 1994/09/22 14:43:56 adam
* First functional version of lookup with error correction. A 'range'
* specified the maximum number of insertions+deletions+substitutions.
*
#include <dict.h>
char *prog;
-Dict dict;
+static Dict dict;
+
+static int look_hits;
static int lookup_handle (Dict_char *name)
{
+ look_hits++;
printf ("%s\n", name);
return 0;
}
int infosize = 4;
int cache = 10;
int ret;
+ int unique = 0;
+ char *arg;
int no_of_iterations = 0;
int no_of_new = 0, no_of_same = 0, no_of_change = 0;
int no_of_hits = 0, no_of_misses = 0;
- int unique = 0;
- char *arg;
+
prog = argv[0];
if (argc < 2)
}
else
{
+ look_hits = 0;
dict_lookup_ec (dict, ipf_ptr, range, lookup_handle);
+ if (look_hits)
+ no_of_hits++;
+ else
+ no_of_misses++;
}
++no_of_iterations;
ipf_ptr += (i-1);
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: lookup.c,v $
- * Revision 1.2 1994-09-16 15:39:14 adam
+ * Revision 1.3 1994-09-26 10:17:25 adam
+ * Minor changes.
+ *
+ * Revision 1.2 1994/09/16 15:39:14 adam
* Initial code of lookup - not tested yet.
*
* Revision 1.1 1994/08/16 16:26:48 adam
{
memcpy (&subptr, info, sizeof(Dict_ptr));
if (*++str == DICT_EOS)
- return info+sizeof(Dict_ptr)+sizeof(Dict_char);
+ {
+ if (info[sizeof(Dict_ptr)+sizeof(Dict_char)])
+ return info+sizeof(Dict_ptr)+sizeof(Dict_char);
+ return NULL;
+ }
else
{
if (subptr == 0)