Form Phrase Macro
A Form Phrase Macro is a sequence of characters (the macro name) that identifies a sequence (map) of character strings that specify typical variations of a form phrase, such as plural forms, possessie extensions, verb-conjugation forms, etc.
For example, when the macro {ss}
is used in a form phrase specification "actor{ss}"
, or act
, this is a shorthand for the set "actor", "actors", "actor's", "actor(s)"
, or the set "act", "acts", "act's", "act(s)"
respectively.
A form phrase that contains a form phrase macro can be expanded into a set of form phrases that no longer contain the form phrase macro. Thus a form phrase that contains a form phrase macro can be seen as a 'shorthand notation' for the set of form phrases that it can be expanded into.
Purpose
Form phrase macros facilitate the specification of form phrases, by enabling efficient ways of representing plural forms, possessive extensions, verb-conjugation forms, etc.Form Phrase Macro Expansion
The form phrase macro expansion process takes as inputs:
- a form phrase that contains a form phrase macro, and
- a sequence (map) of character strings that is associated with the form phrase macro.
For every character string in the form phrase macro map, the expansion process creates a form phrase that is identical to the form phrase that is input, and then it substitutes the form phrase macro therein with the character string. Thus, The expansion process produces as many form phrases as there are character strings in the form phrase macro map.
Here is an example.
- The input form phrase is
actor{ss}
. - The form phrase macro
ss
is associated with the character string map[ "", "s", "'s", "(s)" ]
.
The result of the expansion process is [ "actor", "actors", "actor's", and "actor(s)" ]
Predefined Form phrase macros
The following table specifies the form phrase macros that can be used by default. The table shows
- the form phrase macro name,
- the list of character strings that is used to create a set of form phrases from the form phrase that includes the macro,
- an example that could appear as a form phrase in a
formPhrases
-field of a curated text, - the set of (simplified)
showtext
s that would match that form phrase:
macro | character string map | example | is exapanded into |
---|---|---|---|
{es} | "e", "es", "ed", "ing" | manag{es} | "manage", "manages", "managed", "managing" |
{ess} | "", "es", "'s", "(es)" | regex{ess} | "regex", "regexes", "regex's", "regex(es)" |
{ss} | "", "s", "'s", "(s)" | actor{ss} | "actor", "actors", "actor's", and "actor(s)" |
{yies} | "y", "y's", "ies" | part{yies} | "party", "party's", and "parties" |
{ying} | "y", "ying", "ies", "ied" | identif{ying} | "identify", "identifying", "identifies", and "identified" |
{able} | "able", "ability" | cap{able} | "capable", "capability" |
The above macro's should be used with care. Here are some tips:
- Use
{es}
only for regular verbs that conjugate as specified. - Use
{ess}
only for nouns whose plural is constructed by addinges
. - Use
{ss}
macro only for nouns whose plural is constructed by adding ans
. - Use
{yies}
only for nouns that end with ay
. - Use
{yies}
only for verbs that end with ay
.
Custom Form Phrase Macros
The set of form phrase macros that is available in a scope is configurable. This allows form phrase macros to be configured, amongst others, to suit languages that have different grammatical rules, such as Dutch or French.
Please refer to the description of form phrase macro maps for details.