miniutter-0.4.0: Simple English clause creation from arbitrary words.

Safe HaskellNone

NLP.Miniutter.English

Description

Simple English clause creation parameterized by individual words.

Synopsis

Documentation

data Part Source

Various basic and compound parts of English simple present tense clauses. Many of the possible nestings do not make sense. We don't care.

Constructors

String !String

handle for a String parameter

Text !Text

handle for a Text parameter

Cardinal !Int

cardinal number, spelled in full up to 10

Ws !Part

plural form of a phrase

NWs !Int !Part

plural prefixed with a cardinal (not spelled)

Ordinal !Int

ordinal number, spelled in full up to 10

NthW !Int !Part

phrase prefixed by an ordinal (not spelled)

AW !Part

phrase with indefinite article

WWandW ![Part]

enumeration

WWxW !Part ![Part]

collection

Wown !Part

non-premodifying possesive

WownW !Part !Part

attributive possesive

Phrase ![Part]

space-separated sequence

!Part :> !Part

no space in between

Capitalize !Part

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

data Person Source

Persons: singular 1st, singular 3rd and the rest.

Constructors

Sg1st 
Sg3rd 
PlEtc 

Instances

data Polarity Source

Generalized polarity: affirmative, negative, interrogative.

Constructors

Yes 
No 
Why 

type Irregular = (Map Text Text, Map Text Text)Source

Nouns with irregular plural form and nouns with irregular indefinite article.

makeSentence :: Irregular -> [Part] -> TextSource

Realise a complete sentence, capitalized, ending with a dot.

makePhrase :: Irregular -> [Part] -> TextSource

Realise a phrase. The spacing between parts resembles the semantics of (<+>), that is, it ignores empty words.

defIrregular :: IrregularSource

Default set of words with irregular forms.

(<>) :: Text -> Text -> Text

Identical to append.

(<+>) :: Text -> Text -> Text

Separated by space unless one of them is empty (in which case just the non-empty one).

showT :: Show a => a -> Text

Show a value in Text format.