Iterable<String> s = Splitter.on(" ").split("Hello World"); Multiset<String> counts = HashMultiSet.create(s); Multiset<String> sorted = Multisets.copyHightestCountFirst(counts);
TreeHashSet.create(Splitter.on(" ").split("Hello World"))
Show the java code that does the same thing and it will be clear that the ruby is more readable.
String[] sents = {"the quick", "the slow", "the blue"}; Iterable<String> s = Splitter.on(" ").split(Joiner.on(" ").join(sents));