Skip to content

Instantly share code, notes, and snippets.

View SentenceAnagram.scala
//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())
You can’t perform that action at this time.