diff options
author | Dom Lachowicz <domlachowicz@gmail.com> | 2008-02-28 19:38:45 +0000 |
---|---|---|
committer | Dom Lachowicz <domlachowicz@gmail.com> | 2008-02-28 19:38:45 +0000 |
commit | 38a4ba407ec7f6f1697e82b44bda4c3bd70ee553 (patch) | |
tree | 64bdc63dd80d3766cf09ee06d70f56ca439b9432 | |
parent | 0e670dbb9110336ad4c89338bb2324b24ce08089 (diff) | |
download | enchant-38a4ba407ec7f6f1697e82b44bda4c3bd70ee553.tar.gz |
include gstdio.h; treat hyphens within words as part of the word (bug 11008)
git-svn-id: svn+ssh://svn.abisource.com/svnroot/enchant/trunk@22971 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6
-rw-r--r-- | tests/enchant-ispell.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/enchant-ispell.c b/tests/enchant-ispell.c index 76af1b9..19fb96b 100644 --- a/tests/enchant-ispell.c +++ b/tests/enchant-ispell.c @@ -43,6 +43,7 @@ #include <stdlib.h> #include <string.h> #include <glib.h> +#include <glib/gstdio.h> #include "enchant.h" #include "enchant-provider.h" @@ -189,7 +190,11 @@ do_mode_l (FILE * out, EnchantDict * dict, GString * word, size_t lineCount) static int is_word_char (gunichar uc, size_t n) { - switch (g_unichar_type(uc)) { + GUnicodeType type; + + type = g_unichar_type(uc); + + switch (type) { case G_UNICODE_MODIFIER_LETTER: case G_UNICODE_LOWERCASE_LETTER: case G_UNICODE_TITLECASE_LETTER: @@ -207,6 +212,10 @@ is_word_char (gunichar uc, size_t n) if ((n > 0) && (uc == g_utf8_get_char("'"))) { return 1; /** Char ' is accepted only within a word. */ } + else if ((n > 0) && (type == G_UNICODE_DASH_PUNCTUATION)) { + return 1; /* hyphens only accepted within a word. */ + } + return 0; } } |