n-gram model for natural language sentence generation in Ruby