Phrase Algebra as of Today
Four months after Phrase Algebra and Sharpee 2.0, the algebra has grown from 13 kinds to 16. Two of my June examples were never valid syntax, and the Optional and Choice examples contradicted ADR-196, accepted the same day: those two are built in code, never written in a template. This is where things stand in Sharpee 5.4.1.
The 16 kinds
The union is still closed and still grows only by adding kinds, as planned in June. The three new kinds all came out of making room descriptions and dialogue read naturally.
| Kind | Member | Role | Description |
|---|---|---|---|
literal | Literal | Atom | Raw author text |
noun | NounPhrase | Atom | Article + adjectives + noun |
list | PhraseList | Combinator | Serial-comma list |
seq | Sequence | Combinator | Ordered join |
empty | Empty | Atom | Nothing, with no dangling comma |
verb | Verb | Atom | Verb agreed with its subject |
pronoun | Pronoun | Atom | it, them, his, and so on |
number | Numeral | Atom | Digits, words, or ordinal |
verbatim | Verbatim | Atom | Text passed through untouched |
contents | Contents | Combinator | An entity's contents as a list |
slot | Slot | Combinator | Named target others add to |
optional | Optional | Modifier | Phrase or nothing, set in code |
choice | Choice | Modifier | One of several variants |
spliced | Spliced | Wrapper | Snippet joined where it's spliced in |
sentence | Sentence | Atom | Capitalized, punctuated sentence |
quote | Quote | Atom | Quoted speech |
I'd add that this was one of my theoretical inventions that required evidence. Had I been unable to prove that post-turn emission was not only possible, but had logical fidelity for author-control, it would have been a sizable failure for Sharpee. But the results are in and it works as I imagined it might.
The arguments many have against using AI to build things should take into account that although someone may have done this by hand, no one thought to try for the entire 50 years of text adventure platform development. For my own efforts, I leaned heavily on to Claude to discern the correct architecture, but it only wrote the code...it is 100% my invention.