aspell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[aspell-devel] Aspell: Updating Delphi example so that it works


From: Jon P. Grewer
Subject: [aspell-devel] Aspell: Updating Delphi example so that it works
Date: Mon, 19 Mar 2007 23:08:57 -0400
User-agent: Thunderbird 1.5.0.10 (Windows/20070221)

Hello friends,

I am experimenting with spell checking and I really like the Aspell word similarity algorithm. I have two goals.
1.  Get the Delphi Aspell example program working.
2. Convert the existing word similarity algorithm into Delphi Pascal so that I can see if I can improve on it, though it is already quite good.

I will give back all improvements to this community.

So, for my first goal: I have successfully installed Aspell into WinXP pro. I am able to drop files on the desktop icon and get them spell checked. However, the Delphi GUI example is not able to find aspell-15.dll It appears that there is something wrong with how the delphi program interacts with Aspell to retrieve settings.
The following code generates exceptions:

   if assigned(key_info^.def)
   then s:=s+' '+key_info^.def;
   if assigned(key_info^.desc)
   then s:=s+' '+key_info^.desc;

If I comment out all lines that refer to the Def and Desc structures, the program runs ok. What is troubling me is that these structures are PChar structures and should be returning an address of nil if they are empty. Instead they come back with an address of 0xh20000000 which of course is an invalid address. This address is being passed back to the calling program by Aspell-15.dll in by function 'aspell_config_retrieve' which appears (from the delphi example that I have) to be of the format:
function(ths:AspellConfig; key:PChar):PChar; cdecl;
AspellConfig is defined withing delphi as:
 AspellKeyInfo = ^TAspellKeyInfo;
 TAspellKeyInfo = record
 {* the name of the key *}
   name       : PChar;
 {* the key type *}
   type_      : AspellKeyInfoType;
 {* the default value of the key *}
   def        : PChar;
 {* a brief description of the key or null if internal value *}
   desc       : PChar;
 {* other data used by config implementations
  * should be set to 0 if not used *}
   otherdata  : array[0..15] of char;
 end;


Apparently the Def and Desc do not have nil addresses in them instead refer to an invalid address.

Is there something wrong with my data definition or are Def and Desc fields of the wrong type?

Thanks for your comments.

Jon Grewer




reply via email to

[Prev in Thread] Current Thread [Next in Thread]