Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: From the author of WWW:Babelfish

by isotope (Chaplain)
on Feb 22, 2001 at 22:08 UTC ( #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/


Comment on Re: From the author of WWW:Babelfish
Download Code
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
Node Status?
node history
Node Type: note [id://60277]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2015-07-05 21:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (68 votes), past polls