Discussion:
[Aspell-user] Discarding aspell suggestions with C API
Felipe Lema
2013-11-21 15:59:02 UTC
Permalink
Hi, everyone

The documentation instructs on how to recover all suggestions for a
word. Since I'm only interested in the first suggestion, I was wondering
if I _must_ call aspell_string_enumeration_next() until it throws NULL.

//...
const char *word = aspell_string_enumeration_next(aspell_elements);
while (aspell_string_enumeration_next(aspell_elements) )
;
delete_aspell_String_enumeration(elements);
//...


Thanks
Felipe Lema
Kevin Atkinson
2013-11-22 03:28:16 UTC
Permalink
Hi,

You should't need to call aspell_string_enumeration_next unless it
returns null. delete_aspell_string_enumeration will clean up any
resources used.

Kevin
Post by Felipe Lema
Hi, everyone
The documentation instructs on how to recover all suggestions for a
word. Since I'm only interested in the first suggestion, I was
wondering if I _must_ call aspell_string_enumeration_next() until it
throws NULL.
//...
const char *word = aspell_string_enumeration_next(aspell_elements);
while (aspell_string_enumeration_next(aspell_elements) )
;
delete_aspell_String_enumeration(elements);
//...
Thanks
Felipe Lema
_______________________________________________
Aspell-user mailing list
https://lists.gnu.org/mailman/listinfo/aspell-user
Kevin Atkinson
2013-11-22 03:33:58 UTC
Permalink
Post by Kevin Atkinson
Hi,
You should't need to call aspell_string_enumeration_next unless it
returns null. delete_aspell_string_enumeration will clean up any
resources used.
That should be "You should't need to call aspell_string_enumeration_next
_until_ it returns null. delete_aspell_string_enumeration will clean up
any resources used."
Post by Kevin Atkinson
Kevin
Post by Felipe Lema
Hi, everyone
The documentation instructs on how to recover all suggestions for a
word. Since I'm only interested in the first suggestion, I was
wondering if I _must_ call aspell_string_enumeration_next() until it
throws NULL.
//...
const char *word = aspell_string_enumeration_next(aspell_elements);
while (aspell_string_enumeration_next(aspell_elements) )
;
delete_aspell_String_enumeration(elements);
//...
Thanks
Felipe Lema
_______________________________________________
Aspell-user mailing list
https://lists.gnu.org/mailman/listinfo/aspell-user
_______________________________________________
Aspell-user mailing list
https://lists.gnu.org/mailman/listinfo/aspell-user
Loading...