#!/usr/bin/python
#
# Soft Computing Topic Generator.
# Copyright (c) 2008, Konstantin Tretyakov
# http://fouryears.eu/2008/10/24/prospective-topics-in-soft-computing/
#
RULES = {
"
":
[" for ",
" by ",
" for with ",
"the role of in ",
" description of ",
" in a framework"],
"":
["",
" "],
"":
["",
" ",
" ",
" ",
" "],
"" :
["ly",
"robust",
"interdisciplinary",
"high-quality"],
"" :
["statistical",
"probabilistic",
"possibilistic",
"stochastic",
"fuzzy",
"soft",
"imperfect",
"imprecise",
"monte-carlo",
"random",
"randomized",
"approximate",
"graphical",
"bayesian",
"mcmc",
"markov",
"robust",
"intensive",
"sensitive",
"dynamic",
"complex",
"nature-inspired",
"efficient",
"combinatorial",
"parametric",
"linear",
"generalized",
"latent"],
"" :
["clustering",
"optimization",
" machine learning",
"search",
"model selection",
"feature selection",
"model discovery",
"experimental design",
"simulation",
"prediction",
"combining and ",
"principal components",
"meta-heuristics",
"embedded methods",
"resampling",
"parameter estimation",
"exploration",
"prediction",
"optimization of ",
"particle-swarm ",
"ant-colony optimization",
"linear models",
"technique",
"density estimation",
"kernel methods",
"structure analysis"],
"" :
["semi-supervised",
"unsupervised",
"supervised"],
"":
[" ",
""],
"" :
["biological network reconstruction",
"interpretability of ",
"modeling of ",
"metabolic engineering",
"decision support",
" representation",
" systems",
" system",
"propagating uncertainty",
""],
"" :
["causal relations",
"previous knowledge",
"statistical criteria",
"real phenomena",
"temporal data",
"uncertainty",
"space-time distributions"]
}
import re, random
TERM = re.compile("<[^>]+>")
def expand(text):
terms = TERM.findall(text)
if len(terms) == 0:
return text
else:
rule = random.choice(RULES[terms[0]])
newtext = text.replace(terms[0], rule, 1)
return expand(newtext)
def capitalize_noun(text):
if text in ['by', 'for', 'in', 'a', 'of', 'with', 'the']:
return text
elif text == 'mcmc':
return 'MCMC'
elif text == 'monte-carlo':
return 'Monte-Carlo'
else:
return text.capitalize()
def capitalize_words(text):
s = ' '.join(map(capitalize_noun, text.split(' ')))
s = s[0].upper() + s[1:]
return s
def gen(num):
return map(lambda x: capitalize_words(expand(x)), [""] * num)
def gen_long():
return filter(lambda x: len(x) > 60, gen(6))
def gen_short():
return filter(lambda x: len(x) < 60, gen(40))
def main():
import sys
lst = gen_long() if sys.argv[-1] == "long" else gen_short()
print ""
if __name__ == "__main__":
main()