Added parameter value checking in generate_phrase
Added unit tests for public methods.