gorzek / loomwords

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

Special replacement taxonomy #11

Open gorzek opened 2 years ago

gorzek commented 2 years ago

In addition to the final replacement file mechanism, add a new replacement taxonomy that behaves as follows:

  1. Any data file named replacement_*.txt is identified.
  2. Every line in that file becomes a target to scan for.
  3. Any occurrences of any entry in a replacement vocab in the input template get replaced with <replacement_[vocab]>.
  4. Then, they are processed like normal templates.

This allows intelligent replacement of common phrases without requiring specially templating them ahead of time. A stock set of replacement vocabs should be shipped with the standard data set.