Forum: Ruby [ANN] babelfish 0.0.1

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Suraj K. (Guest)
on 2008-12-30 11:03
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/tree/master).


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 <removed_email_address@domain.invalid>

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/babelfish/]() for more information.
Suman G. (Guest)
on 2008-12-30 17:15
(Received via mailing list)
wow.. this is great!!!
thanks for sharing, suraj...
Pablo Q. (Guest)
on 2008-12-30 23:02
(Received via mailing list)
right, ver cool!

2008/12/30 Suman G. <removed_email_address@domain.invalid>
James D. (Guest)
on 2008-12-31 06:23
That's awesome.  I can see having a lot of fun with this.
Bernardo R. (Guest)
on 2009-01-01 09:26
(Received via mailing list)
Great, but also take a look
here<http://bermonruf.wordpress.com/2008/05/02/metodo-p...
,
just see the code.
Suraj K. (Guest)
on 2009-01-01 09:48
Bernardo Rufino wrote:
> Great, but also take a look here, just see the code.
> http://bermonruf.wordpress.com/2008/05/02/metodo-p...

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...
This topic is locked and can not be replied to.