Sharpee - Grammar, Identity, and Scoring Updates
The port of mainframe Zork is nearly complete, but I keep running into things that impact the platform so I get sidetracked into improving Sharpee over finishing Dungeo.
Scoring
The most recent refactor from the port of Zork was how we enable scoring in the platform and how the author defines things or removes scoring completely. So we created a scoring capability and service that manage scoring events. This is now completely integrated into Sharpee and the Zork port. Anytime there is a scoring event, the game event source receives 'if.event.score' and the details of why. The Text Service will pick up these events and report as needed. The capability also has the standard ranking system that can be modified or replaced.
Grammar
I'd already made some sweeping changes to the parser/grammar system, but found one refactor and a major improvement. The refactor was just in how we're processing grammar. That file had gotten to 1400 lines of code and it was easy enough to create a factory pattern to break up slot logic. The second one was realizing the implementation was verbose. You had to define "N" and "NORTH" separately or "pattern-specific" and we need "action-specific" definitions to allow for synonyms. Both of these are documented in adr-087 and adr-088.
Identity and Story Form
And the work I'm doing now is to enable 1st, 2nd, and 3rd person as well as a wide range of gender identity configurations for PCs and NPC's.
Pronoun Sets
Available via PRONOUNS constant from @sharpee/world-model:
| Key | Subj | Obj | Poss | Adj | Refl | Verb |
|---|---|---|---|---|---|---|
HE_HIM |
he | him | his | his | himself | sing |
SHE_HER |
she | her | hers | her | herself | sing |
THEY_THEM |
they | them | theirs | their | themselves | plur |
XE_XEM |
xe | xem | xyrs | xyr | xemself | sing |
ZE_ZIR |
ze | zir | zirs | zir | zirself | sing |
ZE_HIR |
ze | hir | hirs | hir | hirself | sing |
EY_EM |
ey | em | eirs | eir | emself | sing |
FAE_FAER |
fae | faer | faers | faer | faerself | sing |
Legend: Subj=Subject, Obj=Object, Poss=Possessive, Adj=Possessive Adjective, Refl=Reflexive, Verb=Verb Form (sing=singular, plur=plural)
Note: Singular "they" uses plural verb forms ("they are", not "they is").
Honorifics
Available via HONORIFICS constant:
| Key | Value | Usage |
|---|---|---|
MR |
Mr. | Mr. Smith |
MRS |
Mrs. | Mrs. Smith |
MS |
Ms. | Ms. Smith |
MX |
Mx. | Mx. Smith (gender-neutral) |
MISS |
Miss | Miss Smith |
DR |
Dr. | Dr. Smith |
PROF |
Prof. | Prof. Smith |
Grammatical Gender
For localization in gendered languages. Separate from pronouns!
| Value | Use Case | Languages |
|---|---|---|
masculine |
Male grammatical agreement | French "il", German "er", Spanish "él" |
feminine |
Female grammatical agreement | French "elle", German "sie", Spanish "ella" |
neuter |
Neuter grammatical agreement | German "es", Swedish default |
common |
Common gender | Swedish "hen", Dutch common gender |
Grammatical Number (Inanimate Objects)
For entities without ActorTrait:
| Value | Pronoun | Example |
|---|---|---|
singular (default) |
it | "Take it" (the lamp) |
plural |
them | "Take them" (the coins) |