Skip to content

Instantly share code, notes, and snippets.

//forked from https://gist.github.com/jkdeveyra/4030815
def sentenceAnagrams(sentence: Sentence): List[Sentence] = {
def subSentence(occ: Occurrences): List[Sentence] = {
if (occ.isEmpty) List(List())
else
for {
x <- combinations(occ)
y <- dictionaryByOccurrences.getOrElse(x, List())