diff options
author | Morgan Astra <m@morganastra.me> | 2016-08-07 03:04:39 -0700 |
---|---|---|
committer | Morgan Astra <m@morganastra.me> | 2016-08-07 03:04:39 -0700 |
commit | f0f6c207daea6efff6422e0a79fa388198fc9d4d (patch) | |
tree | 0026ea96f5d05c9402a53949fb6b8f831bb43917 /src/pronouns/pages.clj | |
parent | c3687318b1e435981c4190a941173ee7ed346d8c (diff) |
add experimental support for multiple pronoun sets
Diffstat (limited to 'src/pronouns/pages.clj')
-rw-r--r-- | src/pronouns/pages.clj | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/src/pronouns/pages.clj b/src/pronouns/pages.clj index 3e63437..2a0c732 100644 --- a/src/pronouns/pages.clj +++ b/src/pronouns/pages.clj @@ -71,20 +71,22 @@ (defn format-pronoun-examples - [subject object possessive-determiner possessive-pronoun reflexive] + [pronoun-declension alternates] + (println pronoun-declension) + (println alternates) (let [title "Pronoun Island: English Language Examples"] - (html - [:html - [:head - [:title title] - [:meta {:name "viewport" :content "width=device-width"}] - [:link {:rel "stylesheet" :href "/pronouns.css"}]] - [:body - (title-block title) - (examples-block subject object possessive-determiner possessive-pronoun reflexive) - (about-block) - (contact-block)]]))) - + (html + [:html + [:head + [:title title] + [:meta {:name "viewport" :content "width=device-width"}] + [:link {:rel "stylesheet" :href "/pronouns.css"}]] + [:body + (title-block title) + (apply examples-block pronoun-declension) + (map #(apply examples-block %) alternates) + (about-block) + (contact-block)]]))) (defn parse-pronouns-with-lookup [pronouns-string pronouns-table] (let [inputs (s/split pronouns-string #"/") @@ -121,8 +123,18 @@ "add them, or issue a pull request at " "https://github.com/witch-house/pronoun.is/blob/master/resources/pronouns.tab")) -(defn pronouns [path pronouns-table] - (let [pronouns (parse-pronouns-with-lookup (escape-html path) pronouns-table)] - (if pronouns - (apply format-pronoun-examples pronouns) +(defn pronouns [params pronouns-table] + (println params) + (let [path (params :*) + ors (u/vec-coerce (params "or")) + a (println path) + pronoun-declension (parse-pronouns-with-lookup (escape-html path) + pronouns-table) + alternates (map #(parse-pronouns-with-lookup (escape-html %) + pronouns-table) + ors) + ] + (println pronoun-declension) + (if pronoun-declension + (format-pronoun-examples pronoun-declension alternates) (not-found)))) |