Yet another LinkGrammar Wrapper issue
Posted: Thu Apr 17, 2014 4:11 pm
Hi all,
I'm still working on a LinkGrammar (http://www.abisource.com/projects/link-grammar/) wrapper for PB, and I'm having a quite interesting issue.
Here's what I have so far: https://dl.dropboxusercontent.com/u/287 ... 3.zip?dl=1
The package includes a x86 dll and static lib, includes and a basic example.
I'm not sure why, but LinkGrammar is unable to find the specified dictionary (see ln. 7 in lg_test.pb). The example is compiled as unicode.
What I managed to find out is that the functions, particularly Dictionary_Set_Data_Dir and possibly Dictionary_Create_Lang expect a utf8 string. If I pass a data directory to Dictionary_Set_Data_Dir, and read it back via a peek, however, the string is cut off right before a colon, e.g. "C:\test" becomes just "C".
If there is no default path specified, a peek returns the proper program directory.
I could think that the dictionary pointer is null because PB does not convert to UTF8 when a string is passed in a function call, but "en" should be the same in both unicode and utf8... I am really out of ideas.
If anyone could take a look at this, and we could fix it, the PB community would gain a quite useful library for language parsing IMHO.
Thanks for any help provided in advance!
Erion
I'm still working on a LinkGrammar (http://www.abisource.com/projects/link-grammar/) wrapper for PB, and I'm having a quite interesting issue.
Here's what I have so far: https://dl.dropboxusercontent.com/u/287 ... 3.zip?dl=1
The package includes a x86 dll and static lib, includes and a basic example.
I'm not sure why, but LinkGrammar is unable to find the specified dictionary (see ln. 7 in lg_test.pb). The example is compiled as unicode.
What I managed to find out is that the functions, particularly Dictionary_Set_Data_Dir and possibly Dictionary_Create_Lang expect a utf8 string. If I pass a data directory to Dictionary_Set_Data_Dir, and read it back via a peek, however, the string is cut off right before a colon, e.g. "C:\test" becomes just "C".
If there is no default path specified, a peek returns the proper program directory.
I could think that the dictionary pointer is null because PB does not convert to UTF8 when a string is passed in a function call, but "en" should be the same in both unicode and utf8... I am really out of ideas.
If anyone could take a look at this, and we could fix it, the PB community would gain a quite useful library for language parsing IMHO.
Thanks for any help provided in advance!
Erion