Chatscript can return the part of speech for words that it knows using the ^POS function. You can also create your own output macros that are like functions. Here is one for plural nouns which simplifies the use of the ^POS function for plural nouns. This allows for one pattern or rule to handle many inputs.
Chatscript stores matched words for any word or concept preceded with an underscore into the variables _0,_1,_2,_3….
You can rename these variables to something more meaningful. I have renamed mine to _star,_star2,_star3…. to be more similar to the AIML syntax it uses for its match tags <star>,<star index=2>, ....
Sample Code:
outputmacro: ^PLURAL(^ARG1) ^POS(NOUN ^ARG1 PLURAL)
rename: _star _0
Topic: ~SEENANIMALS ( see ~animals )
u: ( have you seen {a an} _~animals ) ^keep() ^repeat() I have seen ^PLURAL(_star).
Output:
alaric: > have you seen a dog?
HARRY: I have seen dogs.
alaric: > have you seen a deer?
HARRY: I have seen deer.
alaric: > have you seen a hippopotamus?
HARRY: I have seen hippopotami.