[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: Boyer-Moore string search algorithm in ruby

seebs

7/22/2007 6:05:00 PM

In message <cebd6fd10707220221g67c7c969hd7c022fa08cd091e@mail.gmail.com>, "Nobuyoshi Nakada" wr
ites:
>At Sun, 22 Jul 2007 12:25:01 +0900,
>bcparanj@gmail.com wrote in [ruby-talk:261195]:
>> Does anyone know if this is already part of Ruby open source library?
>> I did not find anything on Google. TIA.

>String#index uses Karp-Rabin algorithm, not Boyer-Moore.

That strikes me as secondary; presumably, the goal is to implement it in Ruby
code, not to determine what algorithm the language internals use, no?

-s

1 Answer

John Joyce

7/23/2007 3:03:00 AM

0


On Jul 22, 2007, at 1:04 PM, Peter Seebach wrote:

> In message
> <cebd6fd10707220221g67c7c969hd7c022fa08cd091e@mail.gmail.com>,
> "Nobuyoshi Nakada" wr
> ites:
>> At Sun, 22 Jul 2007 12:25:01 +0900,
>> bcparanj@gmail.com wrote in [ruby-talk:261195]:
>>> Does anyone know if this is already part of Ruby open source
>>> library?
>>> I did not find anything on Google. TIA.
>
>> String#index uses Karp-Rabin algorithm, not Boyer-Moore.
>
> That strikes me as secondary; presumably, the goal is to implement
> it in Ruby
> code, not to determine what algorithm the language internals use, no?
>
> -s
>
Perhaps if you look into the code for one of those functions, you
might find that it is done in Ruby, you might not.