File: udm_spell.h

package info (click to toggle)
mnogosearch 3.3.7-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 17,484 kB
  • ctags: 4,565
  • sloc: ansic: 94,097; xml: 16,864; sh: 8,915; makefile: 1,727; perl: 801; php: 561; sql: 15
file content (55 lines) | stat: -rw-r--r-- 2,515 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* Copyright (C) 2000-2006 Lavtech.com corp. All rights reserved.

   This program is free software; you can redistribute it and/or modify
   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.
  
   This program is distributed in the hope that it will be useful,
   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
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

#ifndef _UDM_SPELL_H                                 
#define _UDM_SPELL_H

void UdmSpellListListInit(UDM_SPELLLISTLIST *L);
void UdmSpellListListFree(UDM_SPELLLISTLIST *L);
int  UdmSpellListListAdd(UDM_SPELLLISTLIST *L,
                         const char *lang, const char *cset, const char *name);
int  UdmSpellListListLoad(UDM_SPELLLISTLIST *L,
                         char *err, size_t errlen);
int  UdmSpellListListWriteHash(UDM_SPELLLISTLIST *L,
                               char *err, size_t errlen);
int  UdmSpellDump(UDM_SPELLLISTLIST *L, UDM_AFFIXLISTLIST *A,
                  char *err, size_t errlen);

void UdmAffixListListInit(UDM_AFFIXLISTLIST *L);
void UdmAffixListListFree(UDM_AFFIXLISTLIST *L);
int  UdmAffixListListAdd(UDM_AFFIXLISTLIST *L,
                         const char *lang, const char *cset, const char *name);
int UdmAffixListListLoad(UDM_AFFIXLISTLIST *L, int flags, 
                         char *err, size_t errlen);

size_t
UdmSpellNormalize(UDM_SPELLLIST *Sl, UDM_AFFIXLIST *Al,
                  const char *word, UDM_SPELL *Res, size_t nres);
size_t
UdmSpellDenormalize(UDM_SPELLLIST *Sl,
                    UDM_AFFIXLIST *Al,
                    UDM_SPELL *S,
                    char **Res, size_t mres);

/* Backward capability with php-4.3.x */
#define UdmSpellListFree UdmSpellListListFree
#define UdmAffixListFree UdmAffixListListFree
#define UdmImportDictionary(Conf, lang, charset, filename, skip_noflag, first_letters) UdmSpellListListAdd(&Conf->Spells, lang, charset, filename)
#define UdmImportAffixes(Conf, lang, charset, filename) UdmAffixListListAdd(&Conf->Affixes, lang, charset, filename)
#define UdmSortDictionary(Spells)
#define UdmSortAffixes(Affixes, Spells)
#endif