Advanced Search: Matching approximate plural forms
This article describes how to configure FDSE such that a search for any keyword will match the approximate English-language plural form of the word. This feature is disabled by default.
It cannot be stressed enough that:
This feature is approximate. When plural matching is turned on, keyword "moose" will match "moose" or "mooses". Clearly this is wrong, but this will not be fixed. Hopefully about 80% of English nouns will have their plural forms matched correctly and there will be minimal side-effects.
This feature is intended for English-language content only.
Use of this feature may introduce false positives. When plural matching is turned on, keyword "Ye" will match "ye" and "yes", even though "yes" is not related to "ye". The plural-form rules are very conservative and so false positives will be rare.
FDSE applies the plural-matching rules to all keywords, whether or not they are nouns. As an added benefit, the rules cause infinitive verbs to match their singular present tense forms: "explore" will match "explore" and "explores". Possessive pronouns will also match: "its", "hers", "ours", though pronouns are rarely useful as search terms in any form.
Overview of Rules
Rules were copied from http://owl.english.purdue.edu/handouts/grammar/g_spelnoun.html. Thanks purdue.edu!
If the word ends in a vowel and then "o", an optional trailing "s" is supported. stereo, stereos
Otherwise if the word ends in "o", forms with a trailing "es" or "s" will match. echo, echos, echoes
Otherwise if the word ends in "is", forms with the same base but ending in "es" will match. thesis, theses
Otherwise if the word ends in a consonant followed by a "y", forms with the same base but ending in "ies" will match. sky, skies
Otherwise if the word ends with "y", forms with a trailing "s" will match. tray, trays
Otherwise if the word ends in a hissing sound - "s", "z", "x", "sh", "ch" - then a trailing "es" will match. church, churches
Finally, for all other keywords, a trailing "s" is allowed: foo, foos; bar, bars.
Enabling this feature for all searches
To enable this feature for all searches, add the following HTML text to your search form (in the "searchform.htm" template):
<input type="hidden" name="p:pm" value="1" />
You also must add this hidden field to all custom search forms you have embedded in other pages.
Now all searches will match approximate English plural forms.
Allowing this feature at the visitor's option
To allow your visitors to use this feature if they want to, add the following HTML text to your search form (in the "searchform.htm" template):
<input type="hidden" name="p:pm_udav" value="0" /> <input type="checkbox" name="p:pm" value="1" /> Match approximate plural forms; "bug" will match "bug" or "bugs".
In case you're wondering... "p:pm" stands for "persistent - plural match". It is persistent because the value has to be retained across the Next/Previous links in multi-page search results. The "p:pm_udav" refers to the "undefined alt value". This tag is necessary so that FDSE can distinguish between searches in which the p:pm checkbox was present and unchecked, versus search forms in which the tag was not present at all.
History: this feature was added in FDSE version 2.0.0.0052.
Two minor bugs in this feature were fixed in the 0058 release. (One bug involved interoperability between this feature and the "show examples" feature. The other involved extending the plural-match expressions to all member words in a phrase search.)
"Advanced Search: Matching approximate plural forms" https://www.xav.com/scripts/search/help/1116.html