Created
August 31, 2011 17:53
-
-
Save sorenmacbeth/1184188 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn generate-other-words [output-tap root date] | |
(let [others (generate-others root) | |
landings (landings-by-kw root) | |
sq (<- [?ngram ?other ?total-l ?total-pv ?total-b ?total-nv ?total-rv | |
?b-rate ?nv-rate ?rv-rate ?avg-depth] | |
(others ?ngram ?other !kw) | |
(landings !kw ?l ?pv ?b ?nv ?rv) | |
(ybot-stats ?l ?pv ?b ?nv ?rv :> | |
?total-l ?total-pv ?total-b ?total-nv ?total-rv | |
?b-rate ?nv-rate ?rv-rate ?avg-depth))] | |
(?<- "other words" output-tap [?json] | |
(sq ?ngram ?other ?l ?pv ?b ?nv ?rv ?br ?nvr ?rvr ?ad) | |
(write-json-map | |
[[:d :w :ow :l :pv :b :nV :rV :br :nVr :rVr :ad]] | |
(mongo-date date) ?ngram ?other ?l ?pv ?b ?nv ?rv ?br ?nvr ?rvr ?ad :> ?json)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment