|
|
@ -1,6 +1,7 @@
|
|
|
|
(ns com.darklimericks.server.views
|
|
|
|
(ns com.darklimericks.server.views
|
|
|
|
(:require [hiccup.form :as form]
|
|
|
|
(:require [hiccup.form :as form]
|
|
|
|
[hiccup.page :as page]
|
|
|
|
[hiccup.page :as page]
|
|
|
|
|
|
|
|
[oz.core :as oz]
|
|
|
|
[clojure.string :as string]
|
|
|
|
[clojure.string :as string]
|
|
|
|
[com.darklimericks.db.albums :as db.albums]
|
|
|
|
[com.darklimericks.db.albums :as db.albums]
|
|
|
|
[com.darklimericks.db.artists :as db.artists]
|
|
|
|
[com.darklimericks.db.artists :as db.artists]
|
|
|
@ -97,7 +98,9 @@
|
|
|
|
css :css
|
|
|
|
css :css
|
|
|
|
:or {title "DarkLimericks"
|
|
|
|
:or {title "DarkLimericks"
|
|
|
|
css ["/assets/tachyons.css"]
|
|
|
|
css ["/assets/tachyons.css"]
|
|
|
|
js ["/assets/wgu/main.js"]}
|
|
|
|
js ["/assets/vega.js"
|
|
|
|
|
|
|
|
"/assets/vega-lite.js"
|
|
|
|
|
|
|
|
"/assets/vega-embed.js" ]}
|
|
|
|
:as opts} :opts}
|
|
|
|
:as opts} :opts}
|
|
|
|
& body]
|
|
|
|
& body]
|
|
|
|
(println (keys request))
|
|
|
|
(println (keys request))
|
|
|
@ -287,6 +290,8 @@
|
|
|
|
[:div
|
|
|
|
[:div
|
|
|
|
|
|
|
|
|
|
|
|
[:h2 "Generate Rhyme"]
|
|
|
|
[:h2 "Generate Rhyme"]
|
|
|
|
|
|
|
|
(when rhymes
|
|
|
|
|
|
|
|
rhymes)
|
|
|
|
[:div
|
|
|
|
[:div
|
|
|
|
[:p.tl "Use the input field below to enter a word or phrase and view a list
|
|
|
|
[:p.tl "Use the input field below to enter a word or phrase and view a list
|
|
|
|
of words that rhyme. Rhyming words will be sorted by a quality score that represents
|
|
|
|
of words that rhyme. Rhyming words will be sorted by a quality score that represents
|
|
|
@ -304,9 +309,7 @@ how well the rhyme matches your target."]]
|
|
|
|
"rhyme-target")
|
|
|
|
"rhyme-target")
|
|
|
|
(form/submit-button
|
|
|
|
(form/submit-button
|
|
|
|
{:class "ml2"}
|
|
|
|
{:class "ml2"}
|
|
|
|
"Show rhyme suggestions"))
|
|
|
|
"Show rhyme suggestions"))]
|
|
|
|
(when rhymes
|
|
|
|
|
|
|
|
rhymes)]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[:div
|
|
|
|
[:div
|
|
|
|
[:h2 "Generate Rhyming Lyric"]
|
|
|
|
[:h2 "Generate Rhyming Lyric"]
|
|
|
@ -363,6 +366,12 @@ prefixes to that rhyming phrase."]
|
|
|
|
[:div#myChart]
|
|
|
|
[:div#myChart]
|
|
|
|
[:br]
|
|
|
|
[:br]
|
|
|
|
[:br]
|
|
|
|
[:br]
|
|
|
|
|
|
|
|
(oz/embed-for-html
|
|
|
|
|
|
|
|
[:vega
|
|
|
|
|
|
|
|
{:data {:values [{:a 1 :b 2} {:a 3 :b 5} {:a 4 :b 2}]}
|
|
|
|
|
|
|
|
:mark :point
|
|
|
|
|
|
|
|
:encoding {:x {:field :a}
|
|
|
|
|
|
|
|
:y {:field :b}}}])
|
|
|
|
[:br]
|
|
|
|
[:br]
|
|
|
|
[:iframe {:src "/assets/README_WGU.htm"
|
|
|
|
[:iframe {:src "/assets/README_WGU.htm"
|
|
|
|
:style "background-color: white; width: 100%; height: 760px;"}]])
|
|
|
|
:style "background-color: white; width: 100%; height: 760px;"}]])
|
|
|
@ -420,6 +429,20 @@ prefixes to that rhyming phrase."]
|
|
|
|
request
|
|
|
|
request
|
|
|
|
{:rhymes
|
|
|
|
{:rhymes
|
|
|
|
[:div
|
|
|
|
[:div
|
|
|
|
|
|
|
|
(oz/embed-for-html
|
|
|
|
|
|
|
|
[:vega-lite
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{:name :rhyme-quality-popularity
|
|
|
|
|
|
|
|
:mark {:type :point :tooltip {:content :rhyme-quality-popularity}}
|
|
|
|
|
|
|
|
:encoding {:x {:field :freq :scale {:nice true :type :log}}
|
|
|
|
|
|
|
|
:y {:field :quality :sort :descending}}
|
|
|
|
|
|
|
|
:data {:values
|
|
|
|
|
|
|
|
(for [{:keys [word pronunciation rhyme-quality freq]} top-20-rhyme
|
|
|
|
|
|
|
|
i (range 1)]
|
|
|
|
|
|
|
|
{:word word
|
|
|
|
|
|
|
|
:quality rhyme-quality
|
|
|
|
|
|
|
|
:freq freq
|
|
|
|
|
|
|
|
:index i})}}])
|
|
|
|
[:table {:style "margin: auto;"}
|
|
|
|
[:table {:style "margin: auto;"}
|
|
|
|
[:tr [:th "Rhyme"] [:th "Pronunciation"] [:th "Quality"] [:th "Frequency"]]
|
|
|
|
[:tr [:th "Rhyme"] [:th "Pronunciation"] [:th "Quality"] [:th "Frequency"]]
|
|
|
|
(for [{:keys [word pronunciation rhyme-quality freq]} top-20-rhyme]
|
|
|
|
(for [{:keys [word pronunciation rhyme-quality freq]} top-20-rhyme]
|
|
|
|