[Gambas-user] Calling Perl module

MaxVK maximvonk at ...626...
Wed Mar 26 18:55:36 CET 2008



Rob Kudla wrote:
> 
> The way I've used Perl modules from within Gambas in the past (most 
> often with Expect to emulate a TTY) has been to write a Perl script 
> using it, and run that script with EXEC, sending it input and 
> receiving output from it.
> 
> It'd probably be possible to write a gb.perl component to use Perl 
> modules directly, but I don't really know where to begin with that.  
> If we were going the other way we'd probably use the XS Perl module, 
> but I think to access Perl modules you'd basically have to include a 
> Perl interpreter as a component.  This is probably doable (I think 
> exim, the mail server does this to allow perl regular expressions in 
> its config files or something) but I think at that point you might as 
> well just shell out to a Perl script.
> 
> For this particular case, I think an aspell (or hunspell or enchant) 
> Gambas component would be more appropriate, but I don't know what you 
> plan to do with your spellchecker.
> 
> Rob
> 

Hi Rob, thanks for the reply.

The spell checker will be just that - Id like to be able to click a button
and start a spell check that will take each word in turn and check it.

Naturally Id like to implement something to get those nice little wavy red
lines underneath badly spelled words, but one step at a time I think!

Iv taken your suggestion but since I have no Perl at all Iv used Python (My
second Python script!). I used some code I found, and called that from a
Python script using SHELL.

Problem: I can get the return result (From Process_Read), which is a
suggestion for the word if it is incorrect, or is the word itself if it is
spelled correctly. Thats one thing, but I cant actually do anything with it
at the moment. I can go one word at a time, and I can get (remarkably) good
suggestions back, but there is only the option for a single word, and only
the one suggestion.

This was my reasoning behind trying to use Gtk2::Spell - It can open a
window of its own and is (apparently) much faster. Iv seen this behavior in
(for example) Zim, the desktop wiki style editor. However,  Iv yet to find
anything that could explain how to call Gtk2::Spell, from a Perl script or
anything else for that matter.

So I'm still in need of some kind of spell checking mechanism, if anyone has
any ideas.

Cheers

Max
-- 
View this message in context: http://www.nabble.com/Calling-Perl-module-tp16300778p16309242.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list