A means of converting a Conjugation into text, based on clitic ordering rules.
In some languages, there are multiple clitic orderings. For instance, in French, 'nous nous souvenons', 'tu est all�', 'il n'a suit pas' are examples of proclitic ordering, where the bulk of the clitics (nous, tu, ne/n', etc) precede the verb. However, in positive statements only, the reflexive mood uses enclitic ordering where the bulk of the clitics follow the verb, e.g. 'souvenons-nous'.
To support this, one defines multiple CliticOrder instances, and then uses CliticOrderFactory to determine what instance to use, using matches(Conjugation). This method, in turn, determines whether a Conjugation matches the CliticOrder using the predicate
constructor argument, which is an instance of CliticOrder.If.
Once an appropriate CliticOrder has been found, the text is formed by processing a series of CliticOrder.Condition instances in reverse order, in order to deal with elision rules as required. For each Condition found, if the associated condition resolves to true
, the Condition's Then is processed. Each Then can contain plain text, or substitution markers. See Then for supported substitution markers.
If conditions and Then statements rely on reflexive calls to the Conjugation object, in order to determine what classes of clitic to use, and to retrieve the appropriate strings.
@author Duncan Roberts
|
|