-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Simple English clause creation from arbitrary words. -- -- This library helps in generating simple present tense English -- sentences from short, parametrized descriptions. In a typical use, the -- structure of a clause is fixed, but the particular words to be used -- vary in arbitrary ways. The main goal of the library is to minimize -- the API complexity and the code size of programs that use it. The -- library doesn't attempt to ban incorrect English sentences, but just -- make the creation of the simple correct ones easy and predictable. @package miniutter @version 0.4.0 -- | Simple English clause creation parameterized by individual words. module NLP.Miniutter.English -- | Various basic and compound parts of English simple present tense -- clauses. Many of the possible nestings do not make sense. We don't -- care. data Part -- | handle for a String parameter String :: !String -> Part -- | handle for a Text parameter Text :: !Text -> Part -- | cardinal number, spelled in full up to 10 Cardinal :: !Int -> Part -- | plural form of a phrase Ws :: !Part -> Part -- | plural prefixed with a cardinal (not spelled) NWs :: !Int -> !Part -> Part -- | ordinal number, spelled in full up to 10 Ordinal :: !Int -> Part -- | phrase prefixed by an ordinal (not spelled) NthW :: !Int -> !Part -> Part -- | phrase with indefinite article AW :: !Part -> Part -- | enumeration WWandW :: ![Part] -> Part -- | collection WWxW :: !Part -> ![Part] -> Part -- | non-premodifying possesive Wown :: !Part -> Part -- | attributive possesive WownW :: !Part -> !Part -> Part -- | space-separated sequence Phrase :: ![Part] -> Part -- | no space in between (:>) :: !Part -> !Part -> Part -- | make the first letter into a capital letter Capitalize :: !Part -> Part -- | conjugation according to polarity, with a default person (pronouns -- override it) SubjectVerb :: !Person -> !Polarity -> !Part -> !Part -> Part -- | a shorthand for Sg3rd and Yes SubjectVerbSg :: !Part -> !Part -> Part -- | Persons: singular 1st, singular 3rd and the rest. data Person Sg1st :: Person Sg3rd :: Person PlEtc :: Person -- | Generalized polarity: affirmative, negative, interrogative. data Polarity Yes :: Polarity No :: Polarity Why :: Polarity -- | Nouns with irregular plural form and nouns with irregular indefinite -- article. type Irregular = (Map Text Text, Map Text Text) -- | Realise a complete sentence, capitalized, ending with a dot. makeSentence :: Irregular -> [Part] -> Text -- | Realise a phrase. The spacing between parts resembles the semantics of -- (<+>), that is, it ignores empty words. makePhrase :: Irregular -> [Part] -> Text -- | Default set of words with irregular forms. defIrregular :: Irregular -- | Identical to append. (<>) :: Text -> Text -> Text -- | Separated by space unless one of them is empty (in which case just the -- non-empty one). (<+>) :: Text -> Text -> Text -- | Show a value in Text format. showT :: Show a => a -> Text instance Show Person instance Eq Person instance Ord Person instance Show Polarity instance Eq Polarity instance Ord Polarity instance Show Part instance Eq Part instance Ord Part instance IsString Part instance Read Part