see https://code.google.com/p/inflection-js/ for this logic