Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,6 @@
|
|||
Character,Speech
|
||||
The multitude,The messiah! Show us the messiah!
|
||||
Brians mother,<angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry>
|
||||
The multitude,Who are you?
|
||||
Brians mother,I'm his mother; that's who!
|
||||
The multitude,Behold his mother! Behold his mother!
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
(require 'clojure.string)
|
||||
|
||||
(def escapes
|
||||
{\< "<", \> ">", \& "&"})
|
||||
|
||||
(defn escape
|
||||
[content]
|
||||
(clojure.string/escape content escapes))
|
||||
|
||||
(defn tr
|
||||
[cells]
|
||||
(format "<tr>%s</tr>"
|
||||
(apply str (map #(str "<td>" (escape %) "</td>") cells))))
|
||||
|
||||
;; turn a seq of seq of cells into a string.
|
||||
(defn to-html
|
||||
[tbl]
|
||||
(format "<table><tbody>%s</tbody></thead>"
|
||||
(apply str (map tr tbl))))
|
||||
|
||||
;; Read from a string to a seq of seq of cells.
|
||||
(defn from-csv
|
||||
[text]
|
||||
(map #(clojure.string/split % #",")
|
||||
(clojure.string/split-lines text)))
|
||||
|
||||
(defn -main
|
||||
[]
|
||||
(let [lines (line-seq (java.io.BufferedReader. *in*))
|
||||
tbl (map #(clojure.string/split % #",") lines)]
|
||||
(println (to-html tbl)))
|
||||
|
|
@ -0,0 +1 @@
|
|||
<table><tbody><tr><td>Character</td><td>Speech</td></tr><tr><td>The multitude</td><td>The messiah! Show us the messiah!</td></tr><tr><td>Brians mother</td><td><angry>Now you listen here! He's not the messiah; he's a very naughty boy! Now go away!</angry></td></tr><tr><td>The multitude</td><td>Who are you?</td></tr><tr><td>Brians mother</td><td>I'm his mother; that's who!</td></tr><tr><td>The multitude</td><td>Behold his mother! Behold his mother!</td></tr></tbody></thead>
|
||||
Loading…
Add table
Add a link
Reference in a new issue