Created
September 13, 2009 20:07
-
-
Save billdozr/186313 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
;; A CS Research Topic Generator | |
;; in clojure based on: | |
;; http://www.cs.purdue.edu/homes/dec/essay.topic.generator.html | |
(ns com.alenribic.topic-generator | |
(:use [clojure.contrib.str-utils :only (str-join)] | |
[clojure.contrib.seq-utils :only (rand-elt)])) | |
(defn compute-article | |
[word capitalize?] | |
(let [vowels #{\a \e \i \o \u} a (if capitalize? \A \a)] | |
(if (vowels (Character/toLowerCase (first word))) | |
(str a \n) a))) | |
(defn gen-phrase | |
[col1 col2 col3 first-phase?] | |
(let [word1 (rand-elt col1) word2 (rand-elt col2) word3 (rand-elt col3)] | |
(str-join " " [(compute-article word1 first-phase?) word1 word2 word3]))) | |
(defn gen-random-topic [] | |
(let [col1 [ | |
"integrated", "parallel", "virtual", "interactive", "responsive", | |
"synchronized", "balanced", "virtual", "meta-level", "optimized", "active", "parameterized", | |
"conceptual", "scalable", "dynamic", "high-level", "collaborative", "type-safe"] | |
col2 [ | |
"mobile", "functional", "programmable", "distributed", "logical", | |
"digital", "concurrent", "knowledge-based", "multimedia", "binary", "object-oriented", | |
"secure", "high-speed", "real-time", "functional", "parallelizing", "watermarking", | |
"proxy"] | |
col3 [ | |
"network", "preprocessor", "compiler", "system", "interface", | |
"protocol", "architecture", "database", "algorithm", "toolkit", "display", "technology", | |
"solution", "language", "agent", "theorem prover", "work cluster", "cache"] | |
conn ["for", "related to", "derived from", "applied to", "embedded in"]] | |
(str-join " " [(gen-phrase col1 col2 col3 true) | |
(rand-elt conn) (gen-phrase col1 col2 col3 false)]))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment