Skip navigation

Monthly Archives: February 2007

Boyer-Moore string search algorithm in ruby

Update: I cleaned the code up a bit and added more comments.
I was looking for a fast algorithms to search for matching strings. Boyer-Moore seems to be a good choice. It has the peculiar property that it gets faster once you’re looking for longer strings. Wikipedia: Boyer–Moore string search algorithm. This site also has a […]

Pinyin and unicode in ruby

I’m seriously looking into unicode stuff in ruby. Ruby strings are essentially just arrays of bytes, so they’re not very encoding aware. Many have been asking for proper unicode support in ruby, but….

It’s hard to make the string class internally based on an array of code points, for instance, without breaking existing code
ruby comes from […]