Skip to content

Instantly share code, notes, and snippets.

@TattdCodeMonkey
Last active August 24, 2016 01:13
Show Gist options
  • Save TattdCodeMonkey/e0da7afbf73ff2db73f95d6bb083f247 to your computer and use it in GitHub Desktop.
Save TattdCodeMonkey/e0da7afbf73ff2db73f95d6bb083f247 to your computer and use it in GitHub Desktop.
NashFP 8/23/2016
Agent.start_link(&HashDict.new/0, name: :wikipedia)
file_results = []
Enum.each(file_results, fn ({file, words}) ->
Enum.each(words, fn word ->
Agent.update(
:wikipedia,
fn dict ->
Dict.update(dict, word, {file, 1}, fn ({file, cnt}) ->
{file, cnt+1}
end)
end
)
end)
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment