gorzek / loomwords

a dynamic text generation platform
MIT License
1 stars 1 forks source link

Add _verse as a method to generate random text #16

Open galaxnet opened 2 years ago

galaxnet commented 2 years ago

Add <_verse_2_3> as a standard feature to generate text. _verse would pull from very basic sentence templates in the main program (i.e. <_late> on a <_spring> <_morning>, a <_woman> <_strolls> in the <_park>, the <_dog> does not <_approve>, <_later> there is a <_party>)

In <_verse_2_3> the "3" would refer to the number of lines generated and the "2" to the number of lines per paragraph.

Using <_verse> one could easily add a placeholder for a song or poem in a work of fiction, for example.

gorzek commented 2 years ago

Where are the basic sentence templates coming from?

galaxnet commented 2 years ago

No more than 6 short fragments in loomwords.py as described above. As placeholder text, quality does not matter. Otherwise, quality will rely upon the performance of the thesaurus, since no vocabs are shipped with loomwords by default. For added variation, each fragment could randomly be punctuated with a period, coma, colon, or semicolon.

galaxnet commented 2 years ago

To be clear, the sentence fragments would reside in loomwords.py and all variation would occur as the result of thesaurus, fragment order, and punctuation.

gorzek commented 2 years ago

Any such fragments should be data, not code. Do you have some example fragments?

galaxnet commented 2 years ago

Some basic templates I might suggest include:

<_late> on a <_spring> <_morning>, 
a <_woman> <_strolls> in the <_park>, 
the <_dog> does not <_approve>, 
<_later> there is a <_party>,

It's true that including this data in the code is a departure from Loomwords development thus far, but I don't know another way to replicate the placeholder text functionality described otherwise. Even a GPS comes with base maps.

gorzek commented 2 years ago

I can include a set of basic phrases as is done with the thesaurus, though users would certainly be free to edit them as they wish. I'd probably check for a phrases.txt first in the current theme, then in the main data directory, then in the local loomwords.py directory, in that order, so overriding would be easy.

galaxnet commented 2 years ago

That would achieve the desired behavior by the software. Imagine a screenwriter being able to template out their lighting and staging for use with Loomwords and relying on _verse as a way to temporarily fill-in dialogue that's yet to be written. That's the idea.

Loomwords might one day have enough context to associate part of speech with vocabs, which would allow for a lot more versatility here and possibly simplify or eliminate the need for the fragments provided, but until that time, we'll definitely need some sample fragments to make this feature work.