18. April 2015

Finding Semordnilaps

My wife recently developed an interest in semordnilaps, so I thought I would take a stab at writing a script that will find some. What I came up with finds a subset of all two word to two word semordnilaps. Generally you don’t consider whitespace and punctuation in palindromes and semordnilaps, so this code doesn’t either.

more

10. April 2015

PHP’s traits vs. ruby’s modules: Battle of the mix-ins

A mixin is a class-like language construct meant to add functionality to another class. They are not meant to stand on their own, and generally speaking they cannot. Mixins can be used to give different classes the same interface. Mixins can be compared to multiple inheritence in what they let you accomplish, but they don’t work the same way. Rather than inheriting from multiple classes, you mix them in. (Hence the obvious name.)

more

14. February 2015

A Whitespace + Punctuation Tokenizer

In my previous post, I discussed some tokenization techniques and mentioned that a whitespace-only tokenizer will make tokens that are sub-optimal for indexing. I also mentioned that a simple solution to this is created a whitespace + punctuation tokenizer.

more