mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2025-01-17 06:11:49 +01:00
*** empty log message ***
This commit is contained in:
parent
d2ec7dfc1c
commit
c7899d0807
6 changed files with 123 additions and 17 deletions
8
INSTALL
8
INSTALL
|
@ -34,12 +34,4 @@ Installation sous Windows (moins bien/facile)
|
|||
mingw32 et wxMSW soient correctement installés mais cette étape ne
|
||||
rentre pas dans le présent document.
|
||||
|
||||
* Borland/Inprise C/C++ compiler 5.5.1
|
||||
La version en ligne de commande du compilateur Borland est disponible
|
||||
gratuitement par téléchargement. Cet (excellent) compilateur
|
||||
permet aussi de produire un executable d'Eliot.
|
||||
Toujours dans le répertoir eliot\msw il vous faudra taper
|
||||
|
||||
make -f makefile.b32
|
||||
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
# $Id: Makefile.am,v 1.1 2004/04/08 09:43:06 afrab Exp $
|
||||
# $Id: Makefile.am,v 1.2 2004/06/19 18:43:35 afrab Exp $
|
||||
|
||||
bin_PROGRAMS = compdic listdic
|
||||
|
||||
|
@ -26,7 +26,8 @@ libdic_a_CFLAGS=-Wall -pipe -g
|
|||
libdic_a_SOURCES = \
|
||||
dic_internals.h \
|
||||
dic_search.c dic_search.h \
|
||||
dic.c dic.h
|
||||
dic.c dic.h \
|
||||
automaton.c automaton.h
|
||||
|
||||
compdic_SOURCES= \
|
||||
dic_internals.h \
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
/* along with this program; if not, write to the Free Software */
|
||||
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
/*
|
||||
* $Id: dic_search.c,v 1.1 2004/04/08 09:43:06 afrab Exp $
|
||||
* $Id: dic_search.c,v 1.2 2004/06/19 18:43:35 afrab Exp $
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
|
@ -26,7 +26,7 @@
|
|||
#include "dic_internals.h"
|
||||
#include "dic.h"
|
||||
#include "dic_search.h"
|
||||
|
||||
#include "automaton.h"
|
||||
|
||||
/****************************************/
|
||||
/****************************************/
|
||||
|
@ -385,3 +385,78 @@ Dic_search_Cros(Dictionary dic, char* mask, char wordlist[RES_CROS_MAX][DIC_WORD
|
|||
/****************************************/
|
||||
/****************************************/
|
||||
|
||||
struct params_regexp_t {
|
||||
Dictionary dic;
|
||||
int wordlen;
|
||||
int wordlistlen;
|
||||
int wordlistlenmax;
|
||||
struct _automaton *automaton;
|
||||
};
|
||||
|
||||
void
|
||||
Dic_search_regexp_rec(struct params_regexp_t *params, char wordlist[RES_CROS_MAX][DIC_WORD_MAX], Dawg_edge *edgeptr, int state)
|
||||
{
|
||||
// Dawg_edge *current = params->dic->dawg + edgeptr->ptr;
|
||||
/* // fin du motif et fin de mot */
|
||||
/* if (params->mask[params->wordlen] == '\0' && edgeptr->term) */
|
||||
/* { */
|
||||
/* if (params->wordlistlen < params->wordlistlenmax) */
|
||||
/* strcpy(wordlist[params->wordlistlen++],params->mask); */
|
||||
/* } */
|
||||
/* // n'importe quel char */
|
||||
/* else if (params->mask[params->wordlen] == '.') */
|
||||
/* { */
|
||||
/* do */
|
||||
/* { */
|
||||
/* params->mask[params->wordlen] = current->chr + 'a' - 1; */
|
||||
/* params->wordlen ++; */
|
||||
/* Dic_search_regexp_rec(params,wordlist,current, ??); */
|
||||
/* params->wordlen --; */
|
||||
/* params->mask[params->wordlen] = '.'; */
|
||||
/* } */
|
||||
/* while (!(*current++).last); */
|
||||
/* } */
|
||||
/* // une lettre dans le motif */
|
||||
/* else */
|
||||
/* { */
|
||||
/* do */
|
||||
/* { */
|
||||
/* if (current->chr == (params->mask[params->wordlen] & CHAR)) */
|
||||
/* { */
|
||||
/* params->wordlen ++; */
|
||||
/* Dic_search_cross_rec(params,wordlist,current); */
|
||||
/* params->wordlen --; */
|
||||
/* break; */
|
||||
/* } */
|
||||
/* } */
|
||||
/* while (!(*current++).last); */
|
||||
/* } */
|
||||
}
|
||||
|
||||
void
|
||||
Dic_search_RegE(Dictionary dic, char* mask, char wordlist[RES_REGE_MAX][DIC_WORD_MAX])
|
||||
{
|
||||
int i;
|
||||
struct params_regexp_t params;
|
||||
struct _automaton a;
|
||||
|
||||
for(i=0; i < RES_REGE_MAX; i++)
|
||||
wordlist[i][0] = 0;
|
||||
|
||||
if (dic == NULL || mask == NULL)
|
||||
return;
|
||||
|
||||
if (automaton_build("",&a))
|
||||
return;
|
||||
|
||||
params.dic = dic;
|
||||
params.wordlen = 0;
|
||||
params.wordlistlen = 0;
|
||||
params.wordlistlenmax = RES_REGE_MAX;
|
||||
params.automaton = &a;
|
||||
Dic_search_regexp_rec(¶ms, wordlist, dic->dawg + dic->root, 0);
|
||||
}
|
||||
|
||||
/****************************************/
|
||||
/****************************************/
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
/* along with this program; if not, write to the Free Software */
|
||||
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* $Id: dic_search.h,v 1.1 2004/04/08 09:43:06 afrab Exp $ */
|
||||
/* $Id: dic_search.h,v 1.2 2004/06/19 18:43:35 afrab Exp $ */
|
||||
|
||||
#ifndef _DIC_SEARCH_H_
|
||||
#define _DIC_SEARCH_H_
|
||||
|
@ -31,12 +31,14 @@ extern "C"
|
|||
#define RES_RACC_MAX 100
|
||||
#define RES_BENJ_MAX 100
|
||||
#define RES_CROS_MAX 200
|
||||
#define RES_REGE_MAX 200
|
||||
|
||||
int Dic_search_word(Dictionary,const char*);
|
||||
void Dic_search_7pl1(Dictionary,char* rack, char wordlist[LETTERS][RES_7PL1_MAX][DIC_WORD_MAX], int joker);
|
||||
void Dic_search_Racc(Dictionary,char* word, char wordlist[RES_RACC_MAX][DIC_WORD_MAX]);
|
||||
void Dic_search_Benj(Dictionary,char* word, char wordlist[RES_BENJ_MAX][DIC_WORD_MAX]);
|
||||
void Dic_search_Cros(Dictionary,char* mask, char wordlist[RES_CROS_MAX][DIC_WORD_MAX]);
|
||||
void Dic_search_RegE(Dictionary,char* mask, char wordlist[RES_CROS_MAX][DIC_WORD_MAX]);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
/* along with this program; if not, write to the Free Software */
|
||||
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* $Id: main.cc,v 1.1 2004/04/08 09:43:06 afrab Exp $ */
|
||||
/* $Id: main.cc,v 1.2 2004/06/19 18:43:35 afrab Exp $ */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
@ -48,7 +48,7 @@ EliotApp::OnInit()
|
|||
{
|
||||
srand(time(NULL));
|
||||
SetVendorName("Afrab");
|
||||
SetAppName("eliot");
|
||||
SetAppName(wxString("eliot") + wxString("-") + wxString(VERSION));
|
||||
SetClassName("eliot");
|
||||
|
||||
wxConfigBase* config = wxConfigBase::Get();
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
/* along with this program; if not, write to the Free Software */
|
||||
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* $Id: searchpanel.cc,v 1.1 2004/04/08 09:43:06 afrab Exp $ */
|
||||
/* $Id: searchpanel.cc,v 1.2 2004/06/19 18:43:35 afrab Exp $ */
|
||||
|
||||
#include <string.h>
|
||||
#include "ewx.h"
|
||||
|
@ -197,12 +197,48 @@ PPlus1::compute_enter(wxCommandEvent&)
|
|||
// ************************************************************
|
||||
// ************************************************************
|
||||
|
||||
class PRegExp : public SimpleSearchPanel
|
||||
{
|
||||
private:
|
||||
public:
|
||||
void compute_char(wxCommandEvent&) { };
|
||||
void compute_enter(wxCommandEvent&);
|
||||
PRegExp(wxWindow* parent, int id, Dictionary dic) : SimpleSearchPanel(parent,id,dic) {};
|
||||
};
|
||||
|
||||
void
|
||||
PRegExp::compute_enter(wxCommandEvent&)
|
||||
{
|
||||
int i;
|
||||
char re[DIC_WORD_MAX];
|
||||
char buff[RES_REGE_MAX][DIC_WORD_MAX];
|
||||
|
||||
if (!check())
|
||||
return;
|
||||
|
||||
strncpy(re,t->GetValue().c_str(),DIC_WORD_MAX);
|
||||
Dic_search_RegE(dic_,re,buff);
|
||||
|
||||
int resnum = 0;
|
||||
wxString res[RES_REGE_MAX];
|
||||
for(i=0; i < RES_REGE_MAX && buff[i][0]; i++)
|
||||
res[resnum++] = wxString(buff[i]);
|
||||
l->Set(resnum,res);
|
||||
|
||||
if (l->Number() == 0)
|
||||
l->Append("Aucun résultat");
|
||||
}
|
||||
|
||||
// ************************************************************
|
||||
// ************************************************************
|
||||
// ************************************************************
|
||||
|
||||
SearchPanel::SearchPanel(wxFrame *parent, Dictionary dic) :
|
||||
wxNotebook(parent, -1)
|
||||
{
|
||||
AddPage(new PCross(this,ID_PANEL_CROSS,dic),"Mots croisés");
|
||||
AddPage(new PPlus1(this,ID_PANEL_PLUS1,dic),"Plus 1");
|
||||
// AddPage(new PCross(this,ID_PANEL_REGEXP,dic),"RegExp");
|
||||
AddPage(new PRegExp(this,ID_PANEL_REGEXP,dic),"Exp. Rationnelle");
|
||||
SetSelection(0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue