Ask a Question related to Ruby, Design and Development.

  1. #1

    Default Re: Speaking of I18N...

    il Wed, 2 Jul 2003 04:59:05 +0900, "Hal E. Fulton"
    <hal9000@hypermetrics.com> ha scritto::
    >I don't suppose anyone has implemented any
    >kind of interface to babelfish? Something
    >like
    >
    > string2 = babelfish(string, from_lang, to_lang)
    >
    >by any chance?
    there is an example of this in soap4r, or
    in soap4r one of the sample is this ^_^
    gabriele renzi Guest

  2. Similar Questions and Discussions

    1. i18n
      Hi! Are there any turorials how to internationalize a ruby program? Any help is welcome. thx Gergo -- +----------+ |...
    2. speaking of php editors
      Check out vim or emacs... -- BigDog On Mon, 2003-09-22 at 17:41, Chris W. Parker wrote:
    3. gettext i18n
      Hi, Thanks for the reply, but it doesn't work this way either. in /www/locale I do have de/ LC_MESSAGES/ messages.mo de_DE/ LC_MESSAGES/
    4. accessibility question: adding aural pauses to speaking browsers?
      Does anyone know the proper markup to use, or a trick to insert a pause in a speaking browser? I am using IBM Home Page Reader... I have text where...
    5. Speaking of Ruby T-shirts...
      If anyone wants to contribute ideas to the Ruby.shop, feel free... the only pay you get is acknowledgement, however. (See the link at...
  3. #2

    Default Re: Speaking of I18N...


    On the 'ruby developers guide', there is an exemple which do it

    require 'soap/driver'
    ......
    result = driver.BabelFish(lang, input.read)



    gabriele renzi wrote:
    >il Wed, 2 Jul 2003 04:59:05 +0900, "Hal E. Fulton"
    ><hal9000@hypermetrics.com> ha scritto::
    >
    >
    >
    >>I don't suppose anyone has implemented any
    >>kind of interface to babelfish? Something
    >>like
    >>
    >> string2 = babelfish(string, from_lang, to_lang)
    >>
    >>by any chance?
    >>
    >>
    >
    >there is an example of this in soap4r, or
    >in soap4r one of the sample is this ^_^
    >
    >



    Bermejo, Rodrigo Guest

  4. #3

    Default Re: Speaking of I18N...

    Hal E. Fulton wrote:
    >I don't suppose anyone has implemented any
    >kind of interface to babelfish? Something
    >like
    >
    > string2 = babelfish(string, from_lang, to_lang)
    >
    >by any chance?
    >
    >I realize the results it gives are crude.
    >
    >Hal
    >
    >--
    >Hal Fulton
    >hal9000@hypermetrics.com
    >
    >
    >
    I did a screen-scraping one some time back. It was truly a
    several-minute hack. I put it in RAA under the "Jokes" category, but I
    don't think it works anymore (since I depended on the HTML output of
    babelfish for it to work). I should probably either fix it or remove
    it, though I guess being under the Joke category, it's not going to have
    a huge impact on RAA's credibility. :)

    I also had a method called "stupidize", which would translate text to
    and from a language, allowing it to suffer the often hilarious semantic
    distortion that you get from Babelfish.

    Chad



    Chad Fowler Guest

  5. #4

    Default Re: Speaking of I18N...

    ----- Original Message -----
    From: "Bermejo, Rodrigo" <rodrigo.bermejo@ps.ge.com>
    To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
    Sent: Tuesday, July 01, 2003 4:28 PM
    Subject: Re: Speaking of I18N...

    >
    > On the 'ruby developers guide', there is an exemple which do it
    >
    > require 'soap/driver'
    > ......
    > result = driver.BabelFish(lang, input.read)
    I should have known this... I have had that book
    for a long time.

    Thanks,
    Hal

    --
    Hal Fulton
    [email]hal9000@hypermetrics.com[/email]



    Hal E. Fulton Guest

  6. #5

    Default Re: Speaking of I18N...

    ----- Original Message -----
    From: "Chad Fowler" <chadfowler@chadfowler.com>
    To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
    Sent: Tuesday, July 01, 2003 5:53 PM
    Subject: Re: Speaking of I18N...

    > I did a screen-scraping one some time back. It was truly a
    > several-minute hack. I put it in RAA under the "Jokes" category, but I
    > don't think it works anymore (since I depended on the HTML output of
    > babelfish for it to work). I should probably either fix it or remove
    > it, though I guess being under the Joke category, it's not going to have
    > a huge impact on RAA's credibility. :)
    >
    > I also had a method called "stupidize", which would translate text to
    > and from a language, allowing it to suffer the often hilarious semantic
    > distortion that you get from Babelfish.
    That hilarious semantic distortion is also interesting
    in a theoretical sense (to me, at least). I find myself
    sometimes wondering if there might be a way to measure
    the drift in meaning -- I tend to think that a one-way
    translation is probably only "half as garbled" (whatever
    that means!) as a two-way one.

    But if that's true, it implies there must be some way
    to quantify it -- or else my thinking is just nonsense.
    And then that raises issues like: If I translate something
    from English to German and then back again, is more meaning
    lost on the first leg of that trip or the second leg? Is it
    different translating lang X to lang Y for different values
    of X and Y? It would have to be, I think.

    But I've wandered offtopic, as I do so well.

    I'll check out the SOAP4R thing.

    Hal

    --
    Hal Fulton
    [email]hal9000@hypermetrics.com[/email]



    Hal E. Fulton Guest

  7. #6

    Default Re: Speaking of I18N...

    ----- Original Message -----
    From: "Chad Fowler" <chadfowler@chadfowler.com>
    To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
    Sent: Tuesday, July 01, 2003 5:53 PM
    Subject: Re: Speaking of I18N...

    > Hal E. Fulton wrote:
    >
    > >I don't suppose anyone has implemented any
    > >kind of interface to babelfish? Something
    > >like
    > I did a screen-scraping one some time back. It was truly a
    > several-minute hack. I put it in RAA under the "Jokes" category, but I
    > don't think it works anymore (since I depended on the HTML output of
    > babelfish for it to work). I should probably either fix it or remove
    > it, though I guess being under the Joke category, it's not going to have
    > a huge impact on RAA's credibility. :)
    Well, the screen-scraper might be a lightweight option...
    the one with soap4r works great, but I had to install:
    - soap4r
    - rexml
    - http-access2
    - devel-logger

    And I'm not sure any of these work with raa-install. I *thought*
    the first one was working... but I couldn't find any of the
    samples and such, unless I installed manually. And I had to do
    them one at a time, since I could only discover dependencies
    by the "run and crash" method.

    Or to be fair, it might be in the docs. :) :)

    Is raa-install currently healthy? It's supposed to be self-updating,
    but "raa-install -i raa-install" doesn't work for me.

    Cheers,
    Hal

    --
    Hal Fulton
    [email]hal9000@hypermetrics.com[/email]



    Hal E. Fulton Guest

  8. #7

    Default Re: More error backtrace

    On Thu, Jul 03, 2003 at 06:43:03AM +0900, Nigel Gilbert wrote:
    > What I need to know are which lines of code are represented by "... 6
    > levels...". Is there any way of stopping ruby from abbreviating the
    > backtrace like this?
    in eval.c:

    #define TRACE_MAX (TRACE_HEAD+TRACE_TAIL+5)
    #define TRACE_HEAD 8
    #define TRACE_TAIL 5

    So you could change those constants. But easier, wrap your code in something
    like this:

    begin
    ... do your code
    rescue Exception => e
    puts "#{e} (#{e.class})\n#{e.backtrace.join("\n")}"
    end

    Regards,

    Brian.

    Brian Candler Guest

  9. #8

    Default Re: More error backtrace

    I've been wondering for some time why it did this.

    Just curious, what's the rationale for truncating it?

    -Tom

    On Wed, 2003-07-02 at 17:57, Brian Candler wrote:
    > On Thu, Jul 03, 2003 at 06:43:03AM +0900, Nigel Gilbert wrote:
    > > What I need to know are which lines of code are represented by "... 6
    > > levels...". Is there any way of stopping ruby from abbreviating the
    > > backtrace like this?
    >
    > in eval.c:
    >
    > #define TRACE_MAX (TRACE_HEAD+TRACE_TAIL+5)
    > #define TRACE_HEAD 8
    > #define TRACE_TAIL 5
    >
    > So you could change those constants. But easier, wrap your code in something
    > like this:
    >
    > begin
    > ... do your code
    > rescue Exception => e
    > puts "#{e} (#{e.class})\n#{e.backtrace.join("\n")}"
    > end
    >
    > Regards,
    >
    > Brian.
    >
    >

    Tom Clarke Guest

  10. #9

    Default Re: More error backtrace

    ----- Original Message -----
    From: "Tom Clarke" <tom@u2i.com>
    To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
    Sent: Wednesday, July 02, 2003 6:00 PM
    Subject: Re: More error backtrace

    > I've been wondering for some time why it did this.
    >
    > Just curious, what's the rationale for truncating it?
    I always assumed it was to save space. Does it
    do it when the levels are unique? I've personally
    only seen it when there's a recursion problem and
    thus a stack overflow. In a case like that, there's
    no loss of information.

    Hal

    --
    Hal Fulton
    [email]hal9000@hypermetrics.com[/email]


    > -Tom
    >
    > On Wed, 2003-07-02 at 17:57, Brian Candler wrote:
    > > On Thu, Jul 03, 2003 at 06:43:03AM +0900, Nigel Gilbert wrote:
    > > > What I need to know are which lines of code are represented by "... 6
    > > > levels...". Is there any way of stopping ruby from abbreviating the
    > > > backtrace like this?
    > >
    > > in eval.c:
    > >
    > > #define TRACE_MAX (TRACE_HEAD+TRACE_TAIL+5)
    > > #define TRACE_HEAD 8
    > > #define TRACE_TAIL 5
    > >
    > > So you could change those constants. But easier, wrap your code in
    something
    > > like this:
    > >
    > > begin
    > > ... do your code
    > > rescue Exception => e
    > > puts "#{e} (#{e.class})\n#{e.backtrace.join("\n")}"
    > > end
    > >
    > > Regards,
    > >
    > > Brian.
    > >
    > >
    >
    >

    Hal E. Fulton Guest

  11. #10

    Default Re: More error backtrace

    On Thu, Jul 03, 2003 at 08:39:26AM +0900, Hal E. Fulton wrote:
    > > Just curious, what's the rationale for truncating it?
    >
    > I always assumed it was to save space. Does it
    > do it when the levels are unique?
    No, at least not in 1.6.8:

    #define TRACE_MAX (TRACE_HEAD+TRACE_TAIL+5)
    #define TRACE_HEAD 8
    #define TRACE_TAIL 5

    ep = RARRAY(errat);
    for (i=1; i<ep->len; i++) {
    if (TYPE(ep->ptr[i]) == T_STRING) {
    fprintf(stderr, "\tfrom %s\n", RSTRING(ep->ptr[i])->ptr);
    }
    if (i == TRACE_HEAD && ep->len > TRACE_MAX) {
    fprintf(stderr, "\t ... %ld levels...\n",
    ep->len - TRACE_HEAD - TRACE_TAIL);
    i = ep->len - TRACE_TAIL;
    }
    }
    }
    }

    i.e. it shows just the first 8 lines and the last 5 lines.

    Cheers,

    Brian.

    Brian Candler Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139