2009-04-17 12:02:50 +00:00
|
|
|
/* phonetic.c - generic replacement aglogithms for phonetic transformation
|
|
|
|
Copyright (C) 2000 Bjoern Jacke
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License version 2.1 as published by the Free Software Foundation;
|
2017-07-05 15:12:41 +00:00
|
|
|
|
2009-04-17 12:02:50 +00:00
|
|
|
This library 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
|
|
|
|
Lesser General Public License for more details.
|
2017-07-05 15:12:41 +00:00
|
|
|
|
2009-04-17 12:02:50 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this library; If not, see
|
|
|
|
<http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
Changelog:
|
|
|
|
|
|
|
|
2000-01-05 Bjoern Jacke <bjoern at j3e.de>
|
|
|
|
Initial Release insprired by the article about phonetic
|
|
|
|
transformations out of c't 25/1999
|
|
|
|
|
|
|
|
2007-07-26 Bjoern Jacke <bjoern at j3e.de>
|
2017-07-05 15:12:41 +00:00
|
|
|
Released under MPL/GPL/LGPL tri-license for Hunspell
|
|
|
|
|
2009-04-17 12:02:50 +00:00
|
|
|
2007-08-23 Laszlo Nemeth <nemeth at OOo>
|
|
|
|
Porting from Aspell to Hunspell using C-like structs
|
|
|
|
*/
|
|
|
|
|
2017-07-05 15:12:41 +00:00
|
|
|
#ifndef PHONET_HXX_
|
|
|
|
#define PHONET_HXX_
|
2009-04-17 12:02:50 +00:00
|
|
|
|
2017-07-05 15:12:41 +00:00
|
|
|
#define HASHSIZE 256
|
|
|
|
#define MAXPHONETLEN 256
|
|
|
|
#define MAXPHONETUTF8LEN (MAXPHONETLEN * 4)
|
2009-04-17 12:02:50 +00:00
|
|
|
|
2011-07-19 18:27:47 +00:00
|
|
|
#include "hunvisapi.h"
|
|
|
|
|
2009-04-17 12:02:50 +00:00
|
|
|
struct phonetable {
|
|
|
|
char utf8;
|
2017-07-05 15:12:41 +00:00
|
|
|
std::vector<std::string> rules;
|
2009-04-17 12:02:50 +00:00
|
|
|
int hash[HASHSIZE];
|
|
|
|
};
|
|
|
|
|
2017-07-05 15:12:41 +00:00
|
|
|
LIBHUNSPELL_DLL_EXPORTED void init_phonet_hash(phonetable& parms);
|
2009-04-17 12:02:50 +00:00
|
|
|
|
2017-07-05 15:12:41 +00:00
|
|
|
LIBHUNSPELL_DLL_EXPORTED std::string phonet(const std::string& inword,
|
|
|
|
phonetable& phone);
|
2009-04-17 12:02:50 +00:00
|
|
|
|
|
|
|
#endif
|