diff options
Diffstat (limited to 'src/plugins/custom/regmark/metaphone.h')
-rw-r--r-- | src/plugins/custom/regmark/metaphone.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/plugins/custom/regmark/metaphone.h b/src/plugins/custom/regmark/metaphone.h new file mode 100644 index 000000000..4de3292f9 --- /dev/null +++ b/src/plugins/custom/regmark/metaphone.h @@ -0,0 +1,27 @@ +#ifndef RSPAMD_METAPHONE_H +#define RSPAMD_METAPHONE_H + +#include "../../../config.h" + + +#define ENCODE(c) (g_ascii_isalpha(c) ? _codes[((g_ascii_toupper(c)) - 'A')] : 0) + +#define isvowel(c) (ENCODE(c) & 1) /* AEIOU */ + +/* These letters are passed through unchanged */ +#define NOCHANGE(c) (ENCODE(c) & 2) /* FJMNR */ + +/* These form dipthongs when preceding H */ +#define AFFECTH(c) (ENCODE(c) & 4) /* CGPST */ + +/* These make C and G soft */ +#define MAKESOFT(c) (ENCODE(c) & 8) /* EIY */ + +/* These prevent GH from becoming F */ +#define NOGHTOF(c) (ENCODE(c) & 16) /* BDH */ + +#undef USE_TRADITIONAL_METAPHONE + +gboolean metaphone (char *word, int max_phonemes, char **phoned_word); + +#endif |