Skip to content

rversteegen/ProcSentence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ProcSentence (ProcSen)

ProcSentence is a simple but powerful library for procedurally generating grammatical English (for now) text from a list of text fragments, Noun objects, special tokens and random choice lists. It's designed to be easy to use for dynamic or procedural content, as in roguelikes (used in five so far.) Being small, it can be quickly ported to new languages.

sentence(["the", entity1, "^offers", "the", entity2, entity1, "'s", item, ".",
          "the", entity2, "^accepts", "the", item])
	-> "Joules offers you his cash.  You accept it."
	-> "Joules offers the shopkeeper his car keys.  The shopkeeper accepts them."
	-> "You offer the vending machine your banknote.  The machine accepts the note."

It has so far been ported to (these versions are not in sync with each other):

  • GDScript (for Godot)
  • Python 2
    • Long out-of-date
    • Used in Geiger AD '42 (2011 7DRL)
  • C#
    • WIP, untested
  • Preprocessed HamsterSpeak (for the OHRRPGCE)
    • Long out-of-date
    • Used in Carcere Vicis
    • Can't be used as-is; some accomplishing scripts aren't included, and currently requires use of the HamsterSpeak pre-processor. In future will be ported to standard HamsterSpeak once HS gains necessary features.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published