[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Eliot-dev] Changes to eliot/dic/dic_search.c
From: |
eliot-dev |
Subject: |
[Eliot-dev] Changes to eliot/dic/dic_search.c |
Date: |
Sat, 05 Nov 2005 12:56:24 -0500 |
Index: eliot/dic/dic_search.c
diff -u eliot/dic/dic_search.c:1.13 eliot/dic/dic_search.c:1.14
--- eliot/dic/dic_search.c:1.13 Fri Nov 4 20:00:06 2005
+++ eliot/dic/dic_search.c Sat Nov 5 17:56:22 2005
@@ -18,7 +18,7 @@
/* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
- * \file dic_search.h
+ * \file dic_search.c
* \brief Dictionary lookup functions
* \author Antoine Fraboulet
* \date 2002
@@ -415,6 +415,8 @@
struct params_regexp_t {
Dictionary dic;
+ int minlength;
+ int maxlength;
automaton automaton;
struct search_RegE_list_t *charlist;
char word[DIC_WORD_MAX];
@@ -434,7 +436,10 @@
/* if we have a valid word we store it */
if (automaton_get_accept(params->automaton,state) && edgeptr->term)
{
- if (params->wordlistlen < params->wordlistlenmax)
+ int l = strlen(params->word);
+ if (params->wordlistlen < params->wordlistlenmax &&
+ params->minlength <= l &&
+ params->maxlength >= l)
{
strcpy(wordlist[params->wordlistlen++],params->word);
}
@@ -528,6 +533,8 @@
if ((a = automaton_build(root->PP,ptl,PS,list)) != NULL)
{
params.dic = dic;
+ params.minlength = list->minlength;
+ params.maxlength = list->maxlength;
params.automaton = a;
params.charlist = list;
memset(params.word,'\0',sizeof(params.word));