object DoggyEnglish {
val meaningless = Set("name", "of", "the", "my", "your", "in", "what", "which", "was", "is")
val synonyms = Set("city, town", "sibling, siblings", "job, work") .map {
word => word.split(", ").toList
} .collect {
case main::tail => tail map (w => w -> main)
} .flatten .toMap withDefault identity
def simplifyQuestion(question: String) = {
val noPunctuation = question.toLowerCase.replaceAll("[^a-z ]", "")
val words = noPunctuation split " "
val meaningfulWords = words filterNot meaningless
val standardized = meaningfulWords map synonyms
standardized mkString " "
}
}