[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] babelfish 0.0.1

Suraj Kurapati

12/30/2008 9:03:00 AM

babelfish : Ruby interface to Yahoo! BabelFish translation service
==================================================================

This is a completely *unofficial* (and incredibly simple) Ruby
interface to the Yahoo! BabelFish translation service. Enjoy!

The source code is [available via
Git](http://github.com/sunaku/babelfish/t...).


Installation
------------

Run the following command to install this library:

sudo gem install babelfish


Usage: Command Line
--------------------

Here are some examples of using the command-line interface:

# echo "Hello world!" | babelfish en es
¡Hola mundo!

# echo "How are you?" > foo.txt
# babelfish en es foo.txt
¿Cómo está usted?

Run `babelfish --help` to see the list of supported languages.


Usage: Ruby Library
--------------------

Here is an example of using the library in Ruby:

require 'rubygems'
require 'babelfish'

input_text = "I am well, thank you."
input_code = "en"

puts input_text
BabelFish::LANGUAGE_PAIRS[input_code].each do |output_code|
print " in #{BabelFish::LANGUAGE_NAMES[output_code]} is: "
puts BabelFish.translate(input_text, input_code, output_code)
end

The result of running the above example is:

I am well, thank you.
in Italian is: Sono bene, grazie.
in Japanese is: 私はå??æ°?でã?ã??ã?ã?ã??ã?とã?ã??
in German is: Ich fÃ?ehle mich gut, danke.
in French is: Je vais bien, merci.
in Spanish is: Estoy bien, gracias.
in Russian is: Я наилÑ?Ñ?Ñ?им обÑ?азом, вÑ?.
in Chinese-simp is: æ??å¾?好ï¼?谢谢ã??
in Portuguese is: Eu sou bem, obrigado.
in Korean is: ë??ë?? ì?? ì??ë?¤, ë?¹ì? ì? 감ì?¬í??ì?­ì??ì?¤.
in Chinese-trad is:
in Greek is: Î?ίμαι καλά, Ï?αÏ? εÏ?Ï?αριÏ?Ï?Ï?.
in Dutch is: Ik ben goed, dank u.

Read the [RDoc documentation](api/index.html) for more information.


License
-------

Copyright 2007 Suraj N. Kurapati <sunaku@gmail.com>

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.


* * *

Visit [http://snk.tuxfamily.org/lib/...]() for more information.
--
Posted via http://www.ruby-....

5 Answers

Suman Gurung

12/30/2008 3:14:00 PM

0

wow.. this is great!!!
thanks for sharing, suraj...

Pablo Q.

12/30/2008 9:02:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

right, ver cool!

2008/12/30 Suman Gurung <sumangurung@gmail.com>

> wow.. this is great!!!
> thanks for sharing, suraj...
>
>


--
Pablo Q.

James Dinkel

12/31/2008 4:23:00 AM

0

That's awesome. I can see having a lot of fun with this.
--
Posted via http://www.ruby-....

bermonruf

1/1/2009 7:25:00 AM

0

[Note: parts of this message were removed to make it a legal post.]

Great, but also take a look
here<http://bermonruf.wordpress.com/2008/05/02/metodo-para-traduzir-...
,
just see the code.

On Wed, Dec 31, 2008 at 2:23 AM, James Dinkel <jdinkel@gmail.com> wrote:

> That's awesome. I can see having a lot of fun with this.
> --
> Posted via http://www.ruby-....
>
>


--
Bernardo Rufino

Suraj Kurapati

1/1/2009 7:48:00 AM

0

Bernardo Rufino wrote:
> Great, but also take a look here, just see the code.
> http://bermonruf.wordpress.com/2008/05/02/metodo-para-tradu...

I agree, the basic mechanism is the same as the core logic[1] of my gem.

[1]: http://github.com/sunaku/babelfish/tree/master/lib/ba...
--
Posted via http://www.ruby-....