Article rule

From TinyMUX
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

CONFIG PARAMETER: article_rule <article> <regular expression>

DEFAULT: All articles default to a

The article_rule parameter adds a new rule to the list which the art function uses to determine which article to use for a particular word (either a or an). New rules are moved to the head of the rule-list so rules appearing later in the configuration will override rules at the beginning; hence the most general rules should come first followed by a set of exceptions. The art() function tests for matches in order, so only the first matching rule counts.

<article> is either 'a' or 'an' stating what article to give when art() matches input to a rule.

<regular expression> is a regex which forms the body of the rule.

For most games the default set of rules in the configuration files should be sufficient.

Example

> @admin article_rule=an ^[aeiou]

> @admin article_rule=an ^herb

> say art(avocado)

You say "an"

> say art(head)

You say "a"

> say art(herb)

You say "an"

> say art(herbal)

You say "an"

Related Topics

Configuration, art(), Regular Expressions, @admin, config parameters