bratsche/stemmer — pull request #1 by cyranix (2013-10-20 05:24:32+00:00)
Title: Reorganization suggestions

Hi, I saw you mention this repo in the elixir-lang IRC channel. I'm fairly new to Elixir myself, but I thought I might suggest a few changes to make the module read a bit easier. (The actual functionality should be unchanged; I ran a variety of words to make sure that the output was sane, but a good set of test cases would really help this project!)

The most noticeable change is in the handling of exceptional cases -- instead of nesting many control-flow statements, I defined new functions of arity one higher than the original with guard clauses to handle the exceptional cases. I also changed everything but stem/1 to `defp` (since the individual steps aren't particularly reusable AFAIK), added basic docs, and factored out regexes that were used more than once. The rest of the changes are very minor.

Hope you find this useful -- but feel free to modify or decline as you see fit.