1 /* Copyright (C) 2000-2015 Lavtech.com corp. All rights reserved. 2 3 This program is free software; you can redistribute it and/or modify 4 it under the terms of the GNU General Public License as published by 5 the Free Software Foundation; either version 2 of the License, or 6 (at your option) any later version. 7 8 This program is distributed in the hope that it will be useful, 9 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License 14 along with this program; if not, write to the Free Software 15 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 */ 17 18 #ifndef _UDM_SPELL_H 19 #define _UDM_SPELL_H 20 21 void UdmSpellListListInit(UDM_SPELLLISTLIST *L); 22 void UdmSpellListListFree(UDM_SPELLLISTLIST *L); 23 udm_rc_t UdmSpellListListAdd(UDM_SPELLLISTLIST *L, 24 const char *lang, const char *cset, const char *name); 25 udm_rc_t UdmSpellListListLoad(UDM_SPELLLISTLIST *L, 26 char *err, size_t errlen); 27 udm_rc_t UdmSpellListListWriteHash(UDM_SPELLLISTLIST *L, 28 char *err, size_t errlen); 29 udm_rc_t UdmSpellDump(UDM_SPELLLISTLIST *L, UDM_AFFIXLISTLIST *A, 30 char *err, size_t errlen); 31 32 void UdmAffixListListInit(UDM_AFFIXLISTLIST *L); 33 void UdmAffixListListFree(UDM_AFFIXLISTLIST *L); 34 udm_rc_t UdmAffixListListAdd(UDM_AFFIXLISTLIST *L, 35 const char *lang, const char *cset, const char *name); 36 udm_rc_t UdmAffixListListLoad(UDM_AFFIXLISTLIST *L, int flags, 37 char *err, size_t errlen); 38 39 size_t 40 UdmSpellNormalize(UDM_SPELLLIST *Sl, UDM_AFFIXLIST *Al, 41 const char *word, UDM_SPELL *Res, size_t nres); 42 size_t 43 UdmSpellDenormalize(UDM_SPELLLIST *Sl, 44 UDM_AFFIXLIST *Al, 45 UDM_SPELL *S, 46 char **Res, size_t mres); 47 48 /* Backward capability with php-4.3.x */ 49 #define UdmSpellListFree UdmSpellListListFree 50 #define UdmAffixListFree UdmAffixListListFree 51 #define UdmImportDictionary(Conf, lang, charset, filename, skip_noflag, first_letters) UdmSpellListListAdd(&Conf->Spells, lang, charset, filename) 52 #define UdmImportAffixes(Conf, lang, charset, filename) UdmAffixListListAdd(&Conf->Affixes, lang, charset, filename) 53 #define UdmSortDictionary(Spells) 54 #define UdmSortAffixes(Affixes, Spells) 55 #endif 56