phonet.hxx 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* phonetic.c - generic replacement aglogithms for phonetic transformation
  2. Copyright (C) 2000 Bjoern Jacke
  3. This library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License version 2.1 as published by the Free Software Foundation;
  6. This library is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  9. Lesser General Public License for more details.
  10. You should have received a copy of the GNU Lesser General Public
  11. License along with this library; If not, see
  12. <http://www.gnu.org/licenses/>.
  13. Changelog:
  14. 2000-01-05 Bjoern Jacke <bjoern at j3e.de>
  15. Initial Release insprired by the article about phonetic
  16. transformations out of c't 25/1999
  17. 2007-07-26 Bjoern Jacke <bjoern at j3e.de>
  18. Released under MPL/GPL/LGPL tri-license for Hunspell
  19. 2007-08-23 Laszlo Nemeth <nemeth at OOo>
  20. Porting from Aspell to Hunspell using C-like structs
  21. */
  22. #ifndef __PHONETHXX__
  23. #define __PHONETHXX__
  24. #define HASHSIZE 256
  25. #define MAXPHONETLEN 256
  26. #define MAXPHONETUTF8LEN (MAXPHONETLEN * 4)
  27. #include "hunvisapi.h"
  28. struct phonetable {
  29. char utf8;
  30. cs_info * lang;
  31. int num;
  32. char * * rules;
  33. int hash[HASHSIZE];
  34. };
  35. LIBHUNSPELL_DLL_EXPORTED void init_phonet_hash(phonetable & parms);
  36. LIBHUNSPELL_DLL_EXPORTED int phonet (const char * inword, char * target,
  37. int len, phonetable & phone);
  38. #endif