Skip to content

Instantly share code, notes, and snippets.

@randyzwitch
Created July 23, 2013 14:58
Show Gist options
  • Save randyzwitch/6062999 to your computer and use it in GitHub Desktop.
Save randyzwitch/6062999 to your computer and use it in GitHub Desktop.
Julia, Python, looping
#Python looping to create a term-frequency dictionary
from collections import Counter
term_freq = Counter()
for word in english_dictionary:
for url in url_list:
if word in url_list:
term_freq[word] += 1
#Julia looping to create a term-frequency dictionary
term_freq=Dict{String, Int64}()
for word in english_dictionary
for url in url_list
if search(line, word) != (0:-1)
term_freq[word]=get(term_freq,word,0)+1
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment