2004-04-08 11:43:06 +02:00
|
|
|
/* Eliot */
|
2005-05-06 01:45:04 +02:00
|
|
|
/* Copyright (C) 1999 Antoine Fraboulet */
|
2004-04-08 11:43:06 +02:00
|
|
|
/* */
|
2005-05-06 01:45:04 +02:00
|
|
|
/* This file is part of Eliot. */
|
|
|
|
/* */
|
|
|
|
/* Eliot is free software; you can redistribute it and/or modify */
|
2004-04-08 11:43:06 +02:00
|
|
|
/* it under the terms of the GNU General Public License as published by */
|
|
|
|
/* the Free Software Foundation; either version 2 of the License, or */
|
|
|
|
/* (at your option) any later version. */
|
|
|
|
/* */
|
2006-01-01 20:51:00 +01:00
|
|
|
/* Eliot is distributed in the hope that it will be useful, */
|
2004-04-08 11:43:06 +02:00
|
|
|
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
|
|
|
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
|
|
|
/* GNU General Public License for more details. */
|
|
|
|
/* */
|
|
|
|
/* You should have received a copy of the GNU General Public License */
|
|
|
|
/* along with this program; if not, write to the Free Software */
|
2005-10-23 16:53:42 +02:00
|
|
|
/* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
2004-04-08 11:43:06 +02:00
|
|
|
|
2005-04-19 18:26:50 +02:00
|
|
|
/**
|
2006-01-01 20:51:00 +01:00
|
|
|
* \file dic_search.h
|
2005-04-19 18:26:50 +02:00
|
|
|
* \brief Dictionary lookup functions
|
|
|
|
* \author Antoine Fraboulet
|
|
|
|
* \date 2002
|
|
|
|
*/
|
2004-04-08 11:43:06 +02:00
|
|
|
|
|
|
|
#ifndef _DIC_SEARCH_H_
|
|
|
|
#define _DIC_SEARCH_H_
|
|
|
|
#if defined(__cplusplus)
|
2005-11-04 21:00:05 +01:00
|
|
|
extern "C"
|
2004-04-08 11:43:06 +02:00
|
|
|
{
|
2005-11-04 21:00:05 +01:00
|
|
|
#endif
|
2004-04-08 11:43:06 +02:00
|
|
|
|
2005-04-19 18:26:50 +02:00
|
|
|
/**
|
2005-04-26 09:37:55 +02:00
|
|
|
* number of results for Rack+1 search (Dic_search_7pl1)
|
2005-04-19 18:26:50 +02:00
|
|
|
*/
|
2004-04-08 11:43:06 +02:00
|
|
|
#define RES_7PL1_MAX 200
|
2005-04-26 09:37:55 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* number of results for Extensions search (Dic_search_Racc)
|
|
|
|
*/
|
2004-04-08 11:43:06 +02:00
|
|
|
#define RES_RACC_MAX 100
|
2005-04-26 09:37:55 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* number of results for Benjamin search (Dic_search_Benj)
|
|
|
|
*/
|
2004-04-08 11:43:06 +02:00
|
|
|
#define RES_BENJ_MAX 100
|
2005-04-26 09:37:55 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* number of results for CrossWords search (Dic_search_Cros)
|
|
|
|
*/
|
2004-04-08 11:43:06 +02:00
|
|
|
#define RES_CROS_MAX 200
|
2005-04-26 09:37:55 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* number of results for Regular Expression search (Dic_search_RegE)
|
|
|
|
*/
|
2004-06-19 20:43:35 +02:00
|
|
|
#define RES_REGE_MAX 200
|
2004-04-08 11:43:06 +02:00
|
|
|
|
2005-04-19 18:26:50 +02:00
|
|
|
/**
|
|
|
|
* Search for a word in the dictionnary
|
|
|
|
* @param dic : dictionary
|
|
|
|
* @param path : lookup word
|
|
|
|
* @return 1 present, 0 error
|
|
|
|
*/
|
2006-01-22 13:23:52 +01:00
|
|
|
int Dic_search_word(Dictionary dic,
|
|
|
|
const wchar_t* path);
|
2005-04-26 09:37:55 +02:00
|
|
|
|
2005-04-19 18:26:50 +02:00
|
|
|
/**
|
|
|
|
* Search for all feasible word with "rack" plus one letter
|
|
|
|
* @param dic : dictionary
|
|
|
|
* @param rack : letters
|
|
|
|
* @param wordlist : results
|
|
|
|
*/
|
2006-01-22 13:23:52 +01:00
|
|
|
void Dic_search_7pl1(Dictionary dic,
|
|
|
|
const wchar_t* rack,
|
|
|
|
wchar_t wordlist[DIC_LETTERS][RES_7PL1_MAX][DIC_WORD_MAX],
|
|
|
|
int joker);
|
2005-04-26 09:37:55 +02:00
|
|
|
|
2005-04-19 18:26:50 +02:00
|
|
|
/**
|
|
|
|
* Search for all feasible word adding a letter in front or at the end
|
|
|
|
* @param dic : dictionary
|
|
|
|
* @param word : word
|
|
|
|
* @param wordlist : results
|
|
|
|
*/
|
2006-01-22 13:23:52 +01:00
|
|
|
void Dic_search_Racc(Dictionary dic,
|
|
|
|
const wchar_t* word,
|
|
|
|
wchar_t wordlist[RES_RACC_MAX][DIC_WORD_MAX]);
|
2005-04-26 09:37:55 +02:00
|
|
|
|
2005-04-19 18:26:50 +02:00
|
|
|
/**
|
|
|
|
* Search for benjamins
|
|
|
|
* @param dic : dictionary
|
|
|
|
* @param rack : letters
|
|
|
|
* @param wordlist : results
|
|
|
|
*/
|
2006-01-22 13:23:52 +01:00
|
|
|
void Dic_search_Benj(Dictionary dic,
|
|
|
|
const wchar_t* word,
|
|
|
|
wchar_t wordlist[RES_BENJ_MAX][DIC_WORD_MAX]);
|
2005-04-26 09:37:55 +02:00
|
|
|
|
2005-04-19 18:26:50 +02:00
|
|
|
/**
|
2005-11-04 21:00:05 +01:00
|
|
|
* Search for crosswords
|
2005-04-19 18:26:50 +02:00
|
|
|
* @param dic : dictionary
|
|
|
|
* @param rack : letters
|
|
|
|
* @param wordlist : results
|
|
|
|
*/
|
2006-01-22 13:23:52 +01:00
|
|
|
void Dic_search_Cros(Dictionary dic,
|
|
|
|
const wchar_t* mask,
|
|
|
|
wchar_t wordlist[RES_CROS_MAX][DIC_WORD_MAX]);
|
2005-04-26 09:37:55 +02:00
|
|
|
|
2005-04-19 18:26:50 +02:00
|
|
|
/**
|
2005-11-04 21:00:05 +01:00
|
|
|
* Search for words matching a regular expression
|
2005-04-19 18:26:50 +02:00
|
|
|
* @param dic : dictionary
|
|
|
|
* @param re : regular expression
|
|
|
|
* @param wordlist : results
|
|
|
|
*/
|
2006-01-22 13:23:52 +01:00
|
|
|
void Dic_search_RegE(Dictionary dic,
|
|
|
|
const wchar_t* re,
|
|
|
|
wchar_t wordlist[RES_REGE_MAX][DIC_WORD_MAX],
|
|
|
|
struct search_RegE_list_t *list);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal version of Dic_search_RegE, used inside the dictionary.
|
|
|
|
* Please use Dic_search_RegE instead from outside the dic library.
|
|
|
|
*/
|
|
|
|
void Dic_search_RegE_inner(const Dictionary dic, const char* re,
|
|
|
|
char wordlist[RES_REGE_MAX][DIC_WORD_MAX],
|
|
|
|
struct search_RegE_list_t *list);
|
2004-04-08 11:43:06 +02:00
|
|
|
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
}
|
2005-11-04 21:00:05 +01:00
|
|
|
#endif
|
2005-04-19 18:26:50 +02:00
|
|
|
#endif /* _DIC_SEARCH_H_ */
|