Understand plural of a kind via contents of text variable?

Is there any way to set up something like:

[code]Universal plural name is initially “quarks”.

A quark is a kind of thing. Understand universal plural name as the plural of quark.[/code]

that actually works?

An Understand statement has to have a literal string because the compiler is generating a grammar token internally. Or a part of a grammar token.

If you have a finite number of possibilities, you could say

Understand “quarkoi” as the plural of quark when […].
Understand “quarkes” as the plural of quark when […].

Maybe you can use an After reading a command trick? That seems to be what people usually tell me to do when I want something like this.

[code]Lab is a room. A quark is a kind of thing. There are five quarks in lab.

The universal plural name is initially “quarkettoes”.

After reading a command:
let new command be text;
now new command is the player’s command;
replace the word “[universal plural name]” in new command with “lkjhgfds”;
change the text of the player’s command to new command;
say “New command: [new command].”

Understand “lkjhgfds” as the plural of quark.

test me with “get quarkettoes/drop all/get quarkettoesauces”. [/code]

That last test command, and the part that prints the player’s command, is just there to show that this works on whole words.

If you want to be spiffy, your After reading a command rule could check to see if the player has literally typed “lkjhgfds” and tell them to knock it off.

Thank you for the quick reply. It’s more a case of not knowing exactly what the right word would be in advance, so although there will probably be only one, I would like it to be determined at run time.

Assuming that I’m brave enough to try to write my own grammar token, would it be possible to get the parser to NOT recognize the default plural of “quarks”?

That seems like a good backup plan. Thanks for the suggestion.

Understand the printed name property as describing a quark.

So close! With a little housekeeping of that property, “>FOO ALL QUARKOI” will work but not “>FOO QUARKOI”.

Maybe that’s good enough, for now. And maybe it won’t be so hard to write a grammar token for the single word “quarkoi”.

I still would like to be able to keep the parser from accepting “>FOO QUARKS”, though. It looks like whatever you specify with “Understand ‘X’ as the plural of Y.” is always in addition to the assumed plural generated from the kind name.

No, wait – Ex 326 “Masochism Deli” to the rescue. “The plural of X is Y.” replaces the default.

[edit: And, of course, making the kind privately-named can suppress the automatic application of a plural.]