Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: From the author of WWW:Babelfish

by isotope (Deacon)
on Feb 22, 2001 at 22:08 UTC ( [id://60277]=note: print w/replies, xml ) Need Help??


in reply to From the author of WWW:Babelfish
in thread Translating Japanese to English with WWW::Babelfish

*light bulb illuminates*
I re-examined the Babelfish form HTML source... I was thinking it was specifying utf8 as the form encoding type, and was preparing to patch Babelfish.pm to use that encoding, but when I looked more carefully, I realized what I had seen was a hidden field... enc=utf8.
Patching Babelfish.pm as follows does the job, as long as the input has been converted to utf8:
--- WWW/Babelfish.pm~ Wed Feb 21 10:33:42 2001 +++ WWW/Babelfish.pm Thu Feb 22 08:56:09 2001 @@ -148,7 +148,7 @@ CHUNK: foreach $chunk ( $self->_chunk_text($MAXCHUNK, $para) ) { - $req = POST ($BABELFISH_URL, [ 'doit' => 'done', 'urltext' => $ +chunk, 'lp' => $langopt, 'Submit' => 'Translate' ]); + $req = POST ($BABELFISH_URL, [ 'doit' => 'done', 'urltext' => $ +chunk, 'lp' => $langopt, 'Submit' => 'Translate', 'enc' => 'utf8' ]); $ua = new LWP::UserAgent; $ua->proxy('http','http://' . $self->{proxy}) if defined $self- +>{proxy};

--isotope
http://www.skylab.org/~isotope/

Replies are listed 'Best First'.
Re^2: From the author of WWW:Babelfish
by Anonymous Monk on Mar 19, 2014 at 09:32 UTC
    Could you please help me to run your scripts ? I have no experience in Perl, but I managed to install Perl, download your scripts, install Jcode and Babelfish. But when I substitute Babelfish with your script it gives lots of errors. My internet is through a proxy connection so it says it has no internet connection, this is first problem I think, then I don't understand how you input the files that need to be processed. Thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://60277]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-25 09:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found