Simple English clause creation parameterized by individual words.
- data Part
- = String !String
- | Text !Text
- | Cardinal !Int
- | Ws !Part
- | NWs !Int !Part
- | Ordinal !Int
- | NthW !Int !Part
- | AW !Part
- | WWandW ![Part]
- | WWxW !Part ![Part]
- | Wown !Part
- | WownW !Part !Part
- | Phrase ![Part]
- | !Part :> !Part
- | Capitalize !Part
- | SubjectVerb !Person !Polarity !Part !Part
- | SubjectVerbSg !Part !Part
- data Person
- data Polarity
- type Irregular = (Map Text Text, Map Text Text)
- makeSentence :: Irregular -> [Part] -> Text
- makePhrase :: Irregular -> [Part] -> Text
- defIrregular :: Irregular
- (<>) :: Text -> Text -> Text
- (<+>) :: Text -> Text -> Text
- showT :: Show a => a -> Text
Various basic and compound parts of English simple present tense clauses. Many of the possible nestings do not make sense. We don't care.
handle for a String parameter
handle for a Text parameter
cardinal number, spelled in full up to 10
plural form of a phrase
|NWs !Int !Part|
plural prefixed with a cardinal (not spelled)
ordinal number, spelled in full up to 10
|NthW !Int !Part|
phrase prefixed by an ordinal (not spelled)
phrase with indefinite article
|WWxW !Part ![Part]|
|WownW !Part !Part|
|!Part :> !Part|
no space in between
make the first letter into a capital letter
|SubjectVerb !Person !Polarity !Part !Part|
conjugation according to polarity, with a default person (pronouns override it)
|SubjectVerbSg !Part !Part|
a shorthand for Sg3rd and Yes
Persons: singular 1st, singular 3rd and the rest.
Generalized polarity: affirmative, negative, interrogative.
Nouns with irregular plural form and nouns with irregular indefinite article.
Realise a complete sentence, capitalized, ending with a dot.
Realise a phrase. The spacing between parts resembles
the semantics of
(<+>), that is, it ignores empty words.
Separated by space unless one of them is empty (in which case just the non-empty one).