Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions Source/Factories/Trie.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,15 @@ public class Trie {
wordList.append(current.key)
}


//include only children that are words
for child in current.children {
if (child.isFinal == true) {
var findAllWords: ((TrieNode) -> Void)!
findAllWords = { (node: TrieNode) in
for child in node.child {
wordList.append(child.key)
}

findAllWords(child)
}

findAllWords(current)

return wordList

Expand Down