Textonyms: Difference between revisions
Content added Content deleted
m (→{{header|Haskell}}: Tidied) |
m (Swift - simplified code) |
||
Line 2,696: | Line 2,696: | ||
let word = line.lowercased() |
let word = line.lowercased() |
||
if let text = textString(word) { |
if let text = textString(word) { |
||
dict[text, default: []].append(word) |
|||
words.append(word) |
|||
dict[text] = words |
|||
} else { |
|||
dict[text] = [word] |
|||
} |
|||
count += 1 |
count += 1 |
||
} |
} |