I’m not sure that this avoids the “hardcoding” that you mentioned, but here’s a sample implementation:
Version with individual herb plantings
"Garden"
An herb is a kind of value. Some herbs are thyme, rosemary, basil, sage, fennel, marjoram and parsley.
A plant is a kind of thing. A plant is usually fixed in place. A plant has an herb called species. The printed name of a plant is usually "planting of [species of the item described]". The printed plural name of a plant is usually "plantings of [species of the item described]".
The verb to be sprouted from means the species property.
Definition: a sprig is matching if the herb of it is the species of the item described.
Understand the species property as describing a plant.
The Grounds is a region.
The Herb Garden is a room in the Grounds. The Herb Garden is west of the Entrance. “The herb garden is full of culinary herbs, most of which you recognize."
There is a plant. It is sprouted from thyme.
There is a plant. It is sprouted from rosemary.
There is a plant. It is sprouted from basil.
There is a plant. It is sprouted from sage.
There is a plant. It is sprouted from fennel. It is undescribed.
There is a plant. It is sprouted from marjoram. It is undescribed.
There is a plant. It is sprouted from parsley. It is undescribed.
Every plant is in the Garden.
A sprig is a kind of thing. A sprig has an herb. The printed name of a sprig is usually "sprig of [herb]". The printed plural name of a sprig is usually "sprigs of [herb]".
Understand the herb property as describing a sprig.
Understand “herb” and “twig” as a sprig.
Three sprigs are part of every plant.
Does the player mean taking a plant: it is unlikely.
Does the player mean taking a sprig: it is likely.
When play begins:
repeat with bit running through sprigs:
now the herb of bit is the species of a random plant incorporating bit.
Instead of taking a plant when the noun incorporates a sprig:
try taking a random sprig part of the noun.
First Check taking a sprig part of a plant:
let source be the holder of the noun;
now the noun is in the holder of source;
try taking the noun;
unless the noun is carried by the player:
now the noun is part of source;
rule fails;
otherwise:
rule succeeds.
Check taking a sprig when the player carries no sprigs:
say “They won’t miss a few sprigs will they?”;
continue the action.
Check taking a sprig when the player carries exactly one sprig:
say “This will add to the little bouquet.”;
continue the action.
Check taking a sprig when the player carries at least two sprigs:
say “They might actually notice you stealing the plants. Maybe if you get rid of some?” instead.
Before listing contents:
group sprigs together.
Rule for printing the name of a sprig while listing contents:
if the listing group size is at least two:
say "[herb]";
otherwise:
say "sprig of [herb]".
Before grouping together sprigs:
say "sprigs of ".
Rule for clarifying the parser's choice of a plant while taking:
say "(a sprig from [the item described])[command clarification break]".
Definition: a plant is noun-matching if the noun is a sprig and the species of it is the herb of the noun.
After dropping a sprig:
let source be a random noun-matching plant;
now the noun is part of source;
say "You cast away the sprig, which is quickly lost in the greenery."
If any part of this doesn’t suit your purposes, then providing more details about what you want to accomplish would be helpful.
EDIT: Maybe this is closer to what you meant: The plantings are treated as a mass noun.
"Garden II-B"
[A kind of value is different from a kind of thing, but there are many features of Inform that allow them to be used fruitfully in conjunction with things. See WWI 4.5 "Kinds of value" to start.]
An herb is a kind of value. Some herbs are thyme, rosemary, basil, sage, fennel, marjoram and parsley.
[Properties can be applied to kinds of value. See WWI 4.7 "New either/or properties" for this type.]
An herb can be hidden or discovered. Fennel, marjoram and parsley are hidden.
The Grounds is a region.
The Herb Garden is a room in the Grounds. The Herb Garden is west of the Entrance. “The herb garden is full of culinary herbs, most of which you recognize."
[You seem to want to imply various plantings being present, so this lists the "discovered" herbs in the printed name of the mass plantings. See WWI 21.3 Saying lists of values.
The Understand... statement makes it so that the name of any herb will be interpreted as the plantings object. See WWI 17.11 "Understanding values" for more.]
Some plantings are in the Herb Garden. The printed name of the plantings is "plantings of [list of discovered herbs]". Understand "[herb]" as the plantings.
[Sprigs are set up as generic objects whose name and description depend on an assigned herb property. This example uses a "nameless" herb property. See WWI 4.9 Using new kinds of value in properties.]
A sprig is a kind of thing. A sprig has an herb. The printed name of a sprig is usually "sprig of [herb]". The printed plural name of a sprig is usually "sprigs of [herb]".
[This Understand... statement is one of the main motivations for setting up herbs as a kind of value. See WWI 17.15 "Understanding things by their properties" for details.]
Understand the herb property as describing a sprig.
Understand “herb” and “twig” as a sprig.
[This just asserts five "blank" sprigs into existence. They actually start out as sprigs of thyme because thyme is the default value of herb. See WWI 4.11 "Default values of kinds".]
There are five sprigs.
[Because the name of an herb can be understood as both the plantings object or a sprig, this activity rule is useful to preserve the illusion of individual plantings when automatic disambiguation occurs. See WWI 18.30 "Clarifying the parser's choice of something".]
Rule for clarifying the parser's choice of the plantings:
say "(a sprig from the [herb understood] planting)[command clarification break]".
[Deciding which action-processing rulebook to use is something of a stylistic choice. The "before" rulebook is so early that some basic world-model checks are skipped, so in this case an "instead" rule seemed better. See WWI 12.2 "How actions are processed" for some guidance.
This rule is the meat of the illusion: When the player tries to pick the planting, an off-stage sprig is summoned and assigned an herb type matching the herb name used in the player's command. See WWI 17.19 "Understanding kinds of value" for the brief note on the powerful "<kind> understood" phrase.]
Instead of taking the plantings when at least one sprig (called new picking) is off-stage:
now the herb of new picking is the herb understood;
now new picking is in the holder of the plantings;
try taking new picking;
if the player carries new picking, rule succeeds;
otherwise now new picking is off-stage.
[Since these only make sense to display when the action is happening, they're implemented as "carry out" rules. The use of "first" means that they would happen in front of any applicable Standard Rules, important in this case because those Standard Rules will change the number of sprigs carried by the player. See WWi 19.7 "The preamble of a rule".]
First carry out taking a sprig when the player carries no sprigs:
say “They won’t miss a few sprigs will they?”
First carry out taking a sprig when the player carries exactly one sprig:
say “This will add to the little bouquet.”
[Since this one makes sense when the action is being disallowed, the traditional placement is in a "check" rulebook. Note that, although "check" rules are frequently employed to stop actions, they do not stop the action by default. It's necessary to request that explicitly with "stop the action" or similar -- in this case the "instead" keyword is used. See WWI 19.11 "Success and failure" and the general index entry on "stop the action".]
Check taking a sprig when the player carries at least two sprigs:
say “They might actually notice you stealing the plants. Maybe if you get rid of some?” instead.
[These next items are purely for stylistic purposes -- making it easy to imitate the Emily Short style. See 18.14 "Grouping something together". Note that the "listing group size" variable is not documented except for its appearance in the Standard Rules.]
Before listing contents:
group sprigs together.
Rule for printing the name of a sprig while listing contents:
if the listing group size is at least two:
say "[herb]";
otherwise:
say "sprig of [herb]".
Before grouping together sprigs:
say "sprigs of ".
[This every turn rule is necessary to reset it every turn to prevent a situation in which dropping one herb after carrying two leaves the printed name of the one in inventory as just the herb name. Placement in this rulebook means that it will only happen after action-processing is finished. See WWI 9.5 "Every turn".]
Every turn:
now listing group size is one.
[You didn't have anything like this in your original attempt, but if you want recyclable items it's necessary to recycle them. An "after" rule is used to preclude the normal dropping report. See WWI 7.5 "After rules".]
After dropping a sprig:
now the noun is off-stage;
say "You cast away the sprig, which is quickly lost in the greenery."
Rule for clarifying the parser's choice of a carried sprig:
do nothing.
[It wasn't really clear just why some were declared as undescribed, but this rule acknowledges the player's discovery in future room descriptions. A "before" rule is deliberately chosen because it seems fair that this should happen even if the action ultimately fails. For details on the powerful "(called... )" syntax, see WWI 8.15 "Calling names".]
Before taking a sprig when the herb of the noun is a hidden herb (called new seasoning):
now new seasoning is discovered.
[These use a non-beginner technique to handle attempts to take the plantings directly. The use of "first" for the "instead" rule puts it ahead of the other "instead" rule above.]
To decide which herb is no herb at all:
(- nothing -).
First Instead of taking the plantings when the herb understood is no herb at all:
say "There are so many choices! Perhaps you should select just one at a time."
[This is to prevent the most likely phrasing of attempts to take more than one herb at a time. See WWI 18.33 "Reading a command" for details.]
After reading a command when the player's command includes "and [herb]":
say "You don't want to get caught. Maybe start with just one.";
reject the player's command.
EDIT 2: I’ve added some explanatory comments with citations to documentation for each section of the “mass plantings” version. I’ve also made some tweaks and added some new code, in particular one change to prevent >TAKE PLANTINGS as a command from generating a run-time problem because no herb name is used in the command, and another change to fix an issue with the inventory display.
One thing to note about the “mass plantings” version is that the illusion might work so well as to prompt an experienced player to try combining actions with a command like >TAKE BASIL AND THYME. This will parse, but probably not as desired… the illusion is not preserved, and the effect is that only the last herb name used will be retrieved. Another new rule was added to prevent the worst effects, but it is still possible to craft commands that won’t work correctly, such as >TAKE FENNEL, SAGE.