[prev in list] [next in list] [prev in thread] [next in thread] 

List:       aspell-user
Subject:    [Aspell-user] calling aspell through a pipe
From:       "Dormont, Dan \(Corporate\)" <Dan.Dormont () corporate ! ge ! com>
Date:       2004-12-07 19:43:58
Message-ID: 2C6BEBF06650974FA3361CACA37C66E10704E196 () STAMLVEM01 ! e2k ! ad ! ge ! com
[Download RAW message or body]

I got a good suggestion on calling aspell through a pipe with a text file.  Reprinted with permission of the author:

> From: liz@lizstanley.com [mailto:liz@lizstanley.com]
> Sent: Tuesday, December 07, 2004 1:02 PM
> To: Dormont, Dan (Corporate)
> Subject: calling aspell from Java
> 
> 
> While searching the web I saw your thread on aspell-user and since the thread 
> was so recent, I just wanted to let you know about a solution I came up with 
> that seems to be working.
> 
> I had been struggling with trying to call aspell from a servlet with the 
> following command:
> 
> "/usr/local/bin/aspell -a --lang=en_US --encoding=utf-8 < 
> /path/to/my/file/tempfile 2>&1"
> 
> Of course I ran into the same problem described in the thread, and found this 
> article somewhat helpful:
> 
> http://www.mountainstorm.com/publications/javazine.html
> 
> According to that article, redirection should be possible. However, even 
> trying that approach, I still couldn't get the redirection to work so here's 
> what I did. I wrote a shell script that takes the tempfile as a variable, 
> called it aspellScript.sh, containing the following:
> 
> /usr/local/bin/aspell -a --lang=en_US --encoding=utf-8 < $1 2>&1
> 
> So instead of calling aspell and specifiying all the options from the Java 
> code, I simply call the shell script and pass the tempfile name as an argument 
> to populate the $1 variable in the script. The string I now pass to the exec 
> method is just:
> 
> "/path/to/my/script/aspellScript.sh " + tempfile
> 
> It works fine, at least from my command line test client. I'm sure the same 
> can be done on windows. Not elegant, but it gets the job done. Hope that helps.
> 
> 
> 
> thanks,
> 
> Liz
> liz@lizstanley.com


Daniel Dormont 
____________________________________ 
SupportCentral - GE Corporate 
900 Chapel Street, 7th. Floor 
New Haven, CT 06510 
Ph:(203) 787-7028 Dial-Comm 8*233-7028 
E-Mail : dan.dormont@corporate.ge.com 





[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic