Всем привет! Задача такая, нужно вывести предложение текста, в котором больше всего слов. Есть только самое начало, по scala не нашел особо литературы, может кто может помочь
import io.Source 
object tryagain {
  def main(args: Array[String]) { 
text("US President-elect Donald Trump has defended his handling of the transition to the White House, amid reports of disarray in his team. A new sentence for text.") 
}
 def text(news: String) 
{ 
news.split(" ").groupBy(x=>x) 
val counts = news.split("\\W+").groupBy(x=>x).mapValues(x=>x.length) 
printsomething(counts) 
}

