| ("a", 1),
| ("the", 2),
| ("dragon", 1),
| ("the", 1),
| ("a", 3),
| ("word", 2)
| )
scala> val k = 2
k: Int = 2
scala> val agg = Aggregator.fromSemigroup(SpaceSaver.spaceSaverSemiGroup[String]).composePrepare{ (x: (String, Int)) => SpaceSaver(k * 5, x._1, x._2) }.andThenPresent{ ss => ss.topK(k).map{ case (string, approx, _) => (string, approx.estimate) }}
agg: com.twitter.algebird.Aggregator[(String, Int),com.twitter.algebird.SpaceSaver[String],Seq[(String, Long)]] = com.twitter.algebird.Aggregator$$anon$15@36388414
scala> agg(list)
res6: Seq[(String, Long)] = List((a,4), (the,3))