msevior ([info]msevior) wrote,

I love stuff like this.

A few days ago I got an email of the blue from Daniel Naber ( http://www.danielnaber.de ) who will be giving a talk at a OO.o convention about OO's linguistic capabilities. He asked if the grammar checking facility we have in AbiWord can give suggestions for incorrect grammar as well as marking incorrect regions.

Unfortunately link-grammar, which we use for our grammar checker, does not have this capability and told him that. He then told me about his project, LanguageTool. LanguageTool is written in java, can currently grammar check in English and German and provides natural language descriptions of suspected grammatical mistakes.

I asked him if he'd tried gjc and if he knew how provide a C/C interface to his code. If we can work this out, the AbiWord side of things is very straight forward. We only have to subclass one existing piece of code in a plugin and wrap his code with a two method API. It's all in a plugin so it won't disturb the rest of our codebase.

If we can work out how to use gcj and do the C/C interface we'll can test out his grammar checker in AbiWord in less than one week of real time.

Unfortunately neither he nor I know how to make a gcj <-> C/C bridge. So if you do, let us know and we'll Rock On with Free SoftwareTM :-)

  • Post a new comment

    Error

    Your IP address will be recorded 

  • 10 comments

Anonymous

September 20 2005, 03:31:48 UTC 6 years ago

join #gcj on irc.oftc.net ;)

i believe some people have done that with swig, but i am sure te gcjers know it best.

cheers,
dalibor topic

Anonymous

September 20 2005, 03:52:58 UTC 6 years ago

i managed to use a spell checker written in java with Abiword (via enchant actually). What i did was to use JNI calls in C and link it with libgcj. Also CNI can be used to interface with C++, and that's said to be faster than JNI (but not compatible with all JVMs if that's a problem).

Anonymous

September 20 2005, 05:44:12 UTC 6 years ago

Example in Pdftk

I sent e-mail, but maybe strangers should know too...

There's a compact example of how to make C++ call a Java
library in the sources for project Pdftk.

Anonymous

September 20 2005, 07:34:36 UTC 6 years ago

CNI

Maybe CNI is the answer. Apparently, the gcjh tool generates stubs (header files) from java classes.
A look into the gcj website reveals:

http://gcc.gnu.org/onlinedocs/gcj/Invoking-gcjh.html#Invoking-gcjh

Never seen this before, but I hope it helps...

[info]bluey

September 20 2005, 14:23:32 UTC 6 years ago

Preferably a cross-platform solution so we of the win32 can use it as well. :)

Mikey

[info]msevior

September 21 2005, 06:28:24 UTC 6 years ago

Not to worry...

gcj works fine on win32 and OSX so we'd keep our cross platform capabilities.

Cheers

Martin

Anonymous

September 20 2005, 14:40:26 UTC 6 years ago

GCJ bridge

GCJ supports both JNI (the "Java Native Interface" standard for interfacing with C libraries) and the significantly more reasonably "CNI". In the GCC manual, there is a page that talks about CNI:
http://gcc.gnu.org/onlinedocs/gcc-4.0.1/gcj/About-CNI.html

I suspect that since you'll be wanting to access Java code from C++, you'll likely want to read the "Invocation" chapter. I'm not sure if this can be accomplished using the standard JNI interface, or if that is only intended for accessing platform libraries from Java and not the other way around.

[info]msevior

September 21 2005, 06:27:07 UTC 6 years ago

Thanks everyone!

Thanks to everyone who responded. We now have enough clues to work out how to do the gcj <-> C/C++ bridge.

I really appreciate the help. It's what makes free software such a powerful and fun activity.

Cheers

Martin

Anonymous

September 21 2005, 16:22:44 UTC 6 years ago

for gcj c/c++-ification, you may want to check out how pylucene did it:

http://svn.osafoundation.org/pylucene/trunk/README
http://pylucene.osafoundation.org/

Anonymous

September 19 2008, 16:52:07 UTC 3 years ago

Running AbiWord on NT platform via PHP

Hi,

When running AbiWord from PHP on NT server (in my case Server 2003), don't forget to copy the AbiSuite folder from your personal profile folder (\documents and settings\\AbiSuite to the Default User folder under \documents and settings\Default User)

If you don't do this, AbiWord will not output anything.

When you install AbiWord on your server, AbiWord places that profile info under the ID you used to install it. That ID is the one referred to above.

There's probably a more elegant way to make this run, but that's what I found and I hope it helps somebody (I spent many many hours trying to figure this out ... why AbiWord would run in cmd but not when called PHP's exec functions (such as system, exect, shell_exec etc..).
Create an Account
Forgot your login or password?
Facebook Twitter More login options
English • Español • Deutsch • Русский…