On 11/2/07, Kevin Atkinson <[EMAIL PROTECTED]> wrote:
>
> On Fri, 2 Nov 2007, Hypo Stases wrote:
> > The aspell 0.6 English dictionary does not contain
> > geographic (like USA, Vietnam, etc), and some popular
> > words, like Christmas, etc.
> >
> > Am I missing something?
>
> Yes. since they are in there, I just checked.
>

The problem is in case-sensitivity.

Running the attached example outputs:

word "Christmas" - is correct
word "christmas" - is out of dictionary
word "USA" - is correct
word "usa" - is out of dictionary

Some people are using "christmas" and "usa" lower-case words.
Can libaspell spelling be tuned to be non-case-sensitive?

Very truly,
Hypo
/*
  The example is cooked from aspell.cpp
  program.
*/
#include <stdio.h>
#include "iostream.hpp"
#include "posib_err.hpp"
#include "speller.hpp"
#include "aspell.h"
#include "gettext.h"



using namespace aspell;


void print_error(ParmString msg)
{
  CERR.printf(_("Error: %s\n"), msg.str());
}

void print_error(ParmString msg, ParmString str)
{
  CERR.put(_("Error: "));
  CERR.printf(msg.str(), str.str());
  CERR.put('\n');
}

static void test_word_spelling(AspellSpeller * speller, char* word);

static char* words [] =
{
    "Christmas",
    "christmas",
    "USA",
    "usa",
    NULL
};

int main(int argc, char **argv)
{
    aspell_gettext_init();

    AspellConfig * config = new_aspell_config();
    
    aspell_config_replace(config, "lang", "en");
    
    AspellCanHaveError * ret = new_aspell_speller(config);
    
    if (aspell_error(ret)) 
    {
        print_error (aspell_error_message(ret));
        exit(1);
    }

    AspellSpeller * speller = to_aspell_speller(ret);

    int i = 0;
    char* w = NULL;

    while ((w = words[i++]))
        test_word_spelling (speller, w);

    return 0;
}

static void test_word_spelling(AspellSpeller * speller, char* word)
{
    int result = -1;
    result = aspell_speller_check(speller, word, -1);
	
    if (result == 1)
    {
        printf("word \"%s\" - is correct\n", word);
    }
    else if (result == 0)
    {
        printf("word \"%s\" - is out of dictionary\n", word);
    }
    else
    {
        printf(" aspell_speller_check error, msg %s, word %s\n", 
                aspell_speller_error_message(speller), word);
    }
    return;
}
_______________________________________________
Aspell-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/aspell-devel

Reply via email to