[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Aspell-user] aspell_speller_store_replace on Solaris
From: |
Bill Moseley |
Subject: |
[Aspell-user] aspell_speller_store_replace on Solaris |
Date: |
Thu, 7 Aug 2003 12:57:27 -0700 |
User-agent: |
Mutt/1.5.4i |
This list still alive?
Problem:
aspell_speller_store_replacement() is returning false under
Solaris 5.8 and no error message is returned.
Aspell version 0.50.3 on both platforms.
Kevin (or anyone else), can you give any tips for debugging this?
I've attached some sample code below. Here's the output from that code
on Linux and on Solaris.
I'm making "spiller" a replacement
for "speler":
On Linux:
address@hidden:~/Text-Aspell-0.02$ gcc t.c -laspell && ./a.out
Replacements for speler
speller speer spiller spoiler spooler suppler spell spewer spellers
speaker spiel Pelee peeler sealer seller soler supplier Pele spleen
supple Kepler spelled spieled smeller spearer speeder spiker sprier
stealer sweller
<call replacement function here>
Replacements for speler
spiller speller speer spoiler spooler suppler spell spewer spellers
speaker spiel Pelee peeler sealer seller soler supplier Pele spleen
supple Kepler spelled spieled smeller spearer speeder spiker sprier
stealer sweller
Notice that "spiller" is not listed first.
Under Solaris 5.8 (one of the SourceForge compile farm machines):
bash-2.03$ LD_RUN_PATH=$HOME/aspell/lib gcc spell.c -I$HOME/aspell/include
-L$HOME/aspell/lib -laspell && ./a.out
Replacements for speler
speller speer spiller spoiler spooler suppler spell spewer spellers
speaker spiel Pelee peeler sealer seller supplier Pele spleen supple
Kepler spelled spieled smeller spearer speeder spiker sprier stealer
sweller
Failed to store_replacment:
So store_replacement is failing and not returning any error message.
Here's the code:
#include <stdio.h>
#include <aspell.h>
static void suggest( AspellSpeller * speller, const char *word )
{
const AspellWordList *word_list;
AspellStringEnumeration *els;
const char *suggestion;
word_list = aspell_speller_suggest( speller, word, -1 );
if ( !word_list )
{
printf("Suggest error for word %s: %s\n",
word,
aspell_speller_error_message(speller) );
return;
}
els = aspell_word_list_elements(word_list);
printf("Replacements for %s\n ", word );
while ( (suggestion = aspell_string_enumeration_next(els)) )
printf("%s ", suggestion );
printf("\n\n");
delete_aspell_string_enumeration(els);
}
int main( void )
{
int correct;
int ok;
AspellCanHaveError * possible_err;
AspellSpeller * spell_checker = 0; /* Was manager */
AspellConfig * spell_config = new_aspell_config();
aspell_config_replace(spell_config, "lang", "en_US");
possible_err = new_aspell_speller(spell_config);
if (aspell_error_number(possible_err) != 0)
{
puts(aspell_error_message(possible_err));
return 1;
}
spell_checker = to_aspell_speller(possible_err);
suggest( spell_checker, "speler" );
/* add in a replacement */
ok = aspell_speller_store_replacement( spell_checker, "speler", -1,
"spiller", -1 );
if ( !ok )
{
printf("Failed to store_replacment: %s\n",
aspell_speller_error_message(spell_checker) );
return 1;
}
suggest( spell_checker, "speler" );
return 0;
}
--
Bill Moseley
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Aspell-user] aspell_speller_store_replace on Solaris,
Bill Moseley <=