Loomwords is a dynamic text-generation platform that does not make use of any machine learning or neural network artificial intelligence. It works completely offline to your specifications.
It only requires a Python 3.x installation with default modules.
data
directory along with custom themes, dynamic text replacements are done on your template.person_firstname.txt
containing a line-delimited list of names, using the tag <person_firstname>
in a template will draw one of those names at random.sticky
mechanism. For example, <sticky_mc_person_firstname>
will produce the same output every time it is used in a particular run.<sticky_chapter_incrementer>
<_[word]>
such as <_hot>
or <_cold>
data_[theme]
where [theme]
is the name of your theme, then invoke that theme when running Loomwords. Any vocabularies defined in a theme will override the default vocabularies in the data
directory.source text|replacement text
<_1-99>
to insert random integers. <_word_5-10>
will create a random word 5-10 letters long. <_name_5-10>
will do the same, but capitalized like a name.--runs
parameter, when followed by an integer, will perform that number of runs and output them to the same file separated by a new line.//
. They will be removed from final output and no blank lines they create will be kept.<sticky_mc_pronoun_<sticky_mc_person_gender>>
. So, if the value pulled from person_gender.txt
is male
then the template is interpreted as <sticky_mc_pronoun_male>
.!
to replace sticky_
, !!
to replace sticky_this_
and ++
to replace _incrementer
.usage: loomwords.py [-h] --input_template [INPUT_TEMPLATE] --output_file [OUTPUT_FILE]
[--replacement_file [REPLACEMENT_FILE]] [--theme [THEME]] [--thesaurus_file [THESAURUS_FILE]]
[--runs [RUNS]] [--debug]
Loomwords - a dynamic text generation platform
optional arguments:
-h, --help show this help message and exit
--input_template [INPUT_TEMPLATE]
input template filename
--output_file [OUTPUT_FILE]
output filename
--replacement_file [REPLACEMENT_FILE]
replacements filename
--theme [THEME] theme directory, must match data_[THEME]
--thesaurus_file [THESAURUS_FILE]
custom thesaurus file
--runs [RUNS] number of runs to output
--debug print debugging output
Create a file in the data
directory named person_firstname.txt
with the contents:
Bob
Alice
Caroline
Create a file in the data
directory named person_lastname.txt
with the contents:
Clark
Denson
Edwards
Now, create a file in the data
directory or elsewhere and call it whatever you wish, but template.txt
in the will work. Contents:
This is the <_story> of <person_firstname> <person_lastname>, a <_truly> <_clever> <_person>.
Now, run Loomwords:
python --input_template template.txt --output_file output.txt
You should see output like this:
Loading thesaurus...
Loaded 103306 thesaurus lines with 2550525 synonym cross-references.
Identifying taxonomies...
Loading taxonomies...
Loaded 2 taxonomies with 3 vocabularies and 7 values.
Determining seed text...
Processing templates...
Writing output to file...
Output saved to: output.txt
Open output.txt
and you should see something like:
This is the lie of Alice Edwards, a word by word stand-up comic prefabricate.
It's not Shakespeare, but this should give you an idea of what you can do with this system.
There are a number of features and improvements planned for the future, including:
<my_junk>
and want to change it to <good_stuff>
.--debug
switch do something useful.