|
|
|
@ -1032,7 +1032,12 @@
|
|
|
|
|
banned-words
|
|
|
|
|
(into #{} (->> existing-lines
|
|
|
|
|
(map (comp last last))))
|
|
|
|
|
seed (if existing-lines
|
|
|
|
|
|
|
|
|
|
line
|
|
|
|
|
(take-until
|
|
|
|
|
(best-of-20)
|
|
|
|
|
(fn []
|
|
|
|
|
(let [seed (if existing-lines
|
|
|
|
|
(->> existing-lines
|
|
|
|
|
rand-nth
|
|
|
|
|
reverse
|
|
|
|
@ -1064,15 +1069,14 @@
|
|
|
|
|
database
|
|
|
|
|
(#(vector (rand-nth (phonetics/get-phones %)) %))
|
|
|
|
|
vector))
|
|
|
|
|
line (take-until
|
|
|
|
|
(best-of-20)
|
|
|
|
|
#(tightly-generate-n-syllable-sentence-v2
|
|
|
|
|
line (tightly-generate-n-syllable-sentence-v2
|
|
|
|
|
database
|
|
|
|
|
markov-trie
|
|
|
|
|
4
|
|
|
|
|
syllable-count
|
|
|
|
|
(make-markov-filter [eos bos])
|
|
|
|
|
seed))]
|
|
|
|
|
seed)]
|
|
|
|
|
line)))]
|
|
|
|
|
(recur (rest scheme)
|
|
|
|
|
(update result (first scheme) (fnil conj []) line)))))))
|
|
|
|
|
|
|
|
|
@ -1081,6 +1085,19 @@
|
|
|
|
|
(rhyme-from-scheme-v2
|
|
|
|
|
scheme database markov-tight-trie rhymetrie))
|
|
|
|
|
|
|
|
|
|
(phonetics/get-phones "unleashed")
|
|
|
|
|
(rhymes
|
|
|
|
|
rhymetrie
|
|
|
|
|
["IY" "SH" "T"]
|
|
|
|
|
(fn [choices]
|
|
|
|
|
(->> choices
|
|
|
|
|
(map (fn [[phones wordset]]
|
|
|
|
|
[phones
|
|
|
|
|
(set/difference
|
|
|
|
|
wordset
|
|
|
|
|
#{"unleashed"})]))
|
|
|
|
|
(remove (comp empty? second)))))
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(comment
|
|
|
|
|