Aaron:

I was just trying to find your code, and posted a new thread here 
(before searhing of course) I would like a copy of your spell check 
software, if it's still available.

Paul

--- In flexcoders@yahoogroups.com, "Aaron Miller" <[EMAIL PROTECTED]> 
wrote:
>
> In regards to a free API, I wrote one in PHP a while back that was 
pretty
> simple. You're welcome to use it, but it requires aspell (most *NIX
> environments have it). I had a working Flex demo at one point but 
the server
> is no longer active. Let me know if anyone is interested in seeing 
it and
> I'll dig it up and post it to my new server w/ the source.
> 
> <?php
> 
> //$BASE_DIR = 'C:/wamp/www/spellcheck';
> //$ASPELL = 'C:/wamp/Aspell/bin/aspell.exe'
> 
> $BASE_DIR = '/var/www/spellcheck';
> $ASPELL = 'aspell';
> 
> $descriptorspec = array(
> 0 => array("pipe", "r"), // stdin is a pipe that the child will 
read from
> 1 => array("pipe", "w"), // stdout is a pipe that the child will 
write to
> 2 => array("file", "$BASE_DIR/error-output.txt", "a") // stderr is 
a file to
> write to
> );
> 
> $timestamp = time();
> 
> while( file_exists("$BASE_DIR/$timestamp") ) {
> $timestamp++;
> }
> 
> $buffer_file = "$BASE_DIR/$timestamp";
> 
> if( $_POST['text'] ) {
> file_put_contents( $buffer_file, $_POST['text'] );
> }
> 
> $process = proc_open("$ASPELL -a < $buffer_file", $descriptorspec, 
$pipes );
> 
> $output = stream_get_contents($pipes[1]);
> fclose($pipes[1]);
> @unlink($buffer_file);
> 
> print '<?xml version="1.0" encoding="UTF-8"?>'."\n";
> print '<checkresult>';
> 
> $index = -1;
> foreach( explode( "\n", trim($output)) as $line ) {
> //skip first line (garbage)
> if( $index == -1 ) {
> $index++;
> continue;
> }
> 
> $line = trim($line);
> if( $line != '*' ) {
> print '<mismatch index="'.$index.'" >';
> $sugestions = explode( ',', substr($line, strpos($line, ':')+1) );
> foreach( $sugestions as $word ) {
> print '<word>'.trim($word).'</word>';
> }
> 
> print '</mismatch>';
> }
> 
> $index++;
> }
> 
> print '</checkresult>';
> 
> ?>
> 
> And here is an example XML response.
> 
> 
> <checkresult>
> <mismatch index="1">
> <word>creel</word>
> <word>crawl</word>
> <word>cruel</word>
> <word>crewel</word>
> <word>Creole</word>
> <word>crawly</word>
> <word>creole</word>
> <word>crew</word>
> <word>carrel</word>
> <word>crews</word>
> <word>growl</word>
> <word>creels</word>
> <word>Creek</word>
> <word>creek</word>
> <word>Carrol</word>
> <word>Corella</word>
> <word>Cree</word>
> <word>corral</word>
> <word>cruelly</word>
> <word>reel</word>
> </mismatch>
> <mismatch index="5">
> <word>here</word>
> <word>her</word>
> <word>Herr</word>
> <word>hewer</word>
> <word>jeer</word>
> <word>hexer</word>
> <word>hear</word>
> <word>heir</word>
> <word>hoer</word>
> <word>cheer</word>
> <word>sheer</word>
> <word>Heep</word>
> <word>heed</word>
> <word>heel</word>
> <word>beer</word>
> <word>deer</word>
> <word>leer</word>
> <word>peer</word>
> <word>seer</word>
> <word>veer</word>
> <word>weer</word>
> </mismatch>
> </checkresult>
> 
> Regards,
> ~Aaron
> 
> 
> On 3/19/08, Romeo Obane <[EMAIL PROTECTED]> wrote:
> >
> >   I would also like to ask for an idea in creating a .Net proxy 
server
> > connection that I can use for it?
> >
> > On 3/19/08, Romeo Obane <[EMAIL PROTECTED]> wrote:
> > >
> > > Thanks for the tip, it leads me to read again its docs and 
help file,
> > > which says:
> > >
> > > urlString:String   [write]
> > >
> > > The URL of the proxy used to contact the Google HTTP service
> > >
> > > The default value is "https://www.google.com/tbproxy/spell?
lang="
> > >
> > > Because of Flash player security, the default value will only 
work if
> > > used from within Flex Builder. When deployed to a server, you 
must use a
> > > proxy service within the same domain as the deployed Flex SWF.
> > > Therefore, if you are testing the component from within Flex 
Builder, do
> > > not specify urlString. The component will deal with it 
automatically.
> > >
> > > Example:
> > >
> > > *for testing within Flex Builder:*
> > > <SpellCheckComponent
> > > inputTA="{myTA}"
> > > />
> > >
> > > *For deployment:*
> > > <SpellCheckComponent
> > > inputTA="{myTA}"
> > > urlString="
> > > 
http://myDomain.name.com/flex/spellCheck/myGoogleSpellCheckProxyFile.
cfm<http://mydomain.name.com/flex/spellCheck/myGoogleSpellCheckProxyF
ile.cfm>"
> > >
> > > />
> > >
> > > Regarding the SPL Plus, I believe it is not free. I hope I 
could find a
> > > free one for me to test and use.
> > >
> > >
> > > Cheers,
> > > Romeo
> > >
> > > On 3/19/08, Anirudh Sasikumar <[EMAIL PROTECTED]> wrote:
> > > >
> > > >   Hi,
> > > >
> > > > Google does not seem to have a crossdomain.xml file at
> > > > http://www.google.com/tbproxy/. 
<http://www.google.com/tbproxy/> This
> > > > is probably because spell check
> > > > is not an official API.
> > > >
> > > > Without the crossdomain.xml, flash player will always throw 
a security
> > > > error unless you trust the swf file (which flex builder 
automatically
> > > > does for you).
> > > >
> > > > The sample on bridel.org seems to hit a cfm file (coldfusion 
backend)
> > > > from the same place the swf was served. The coldfusion 
backend in turn
> > > > must be hitting the spell check API. So this does not 
violate flash
> > > > player's security.
> > > >
> > > > Take a look at
> > > > 
http://www.gskinner.com/blog/archives/2007/10/spell_check_eng.html
> > > > for an AS3 spell check engine.
> > > >
> > > >
> > > > On Wed, Mar 19, 2008 at 9:37 AM, Romeo Obane 
<[EMAIL PROTECTED]<romeo%40yoolk.com>>
> > > > wrote:
> > > > >
> > > > > Hi!
> > > > >
> > > > > I would like to ask if anyone has tried to use the Spell 
Checker
> > > > which uses
> > > > > the Google Spell Check API? This is the sample application
> > > > > http://www.bridel.org/flex/spellcheck/flexspellcheck.html 
by Hilary
> > > > Bridel.
> > > > >
> > > > > I'm using it quite a few months already, but now it works 
strangely,
> > > > it
> > > > > works when I'm going to run my application with Flex 
Builder
> > > > (running in my
> > > > > deployment path), but when I published it locally 
(localhost), it
> > > > shows me a
> > > > > busy cursor and doesn't checks for misspelled words. Then 
I tried to
> > > > trace
> > > > > it using "Charles Web Debugging Proxy" and shows me that 
when I'm
> > > > going to
> > > > > access google for the API it returns me 
the "crossdomain.xml" which
> > > > I
> > > > > believe the security policy file of google in using their 
API's.
> > > > >
> > > > > I'm stand corrected for this one, that google put security 
or
> > > > restriction in
> > > > > accessing their services now, and if I'm right, why it 
works during
> > > > my
> > > > > application runs in deployment path than in localhost?
> > > > >
> > > > > One more thing also, do you have some other free spelling 
checker
> > > > > alternative to use?
> > > > >
> > > >
> > > > Cheers,
> > > > --
> > > > Anirudh Sasikumar
> > > > http://anirudhs.chaosnet.org/
> > > >
> > > >
> > >
> > 
> >
>


Reply via email to