GenI-0.22: A natural language generator (specifically, an FB-LTAG surface realiser)

Safe HaskellSafe-Infered





data Params Source

Holds the specification for how Geni should be run, its input files, etc. This is the stuff that would normally be found in the configuration file.




grammarType :: GrammarType
builderType :: BuilderType
customMorph :: Maybe MorphRealiser

Can still be overridden with a morph command mind you

customSelector :: Maybe LexicalSelector

Lexical selection function (if you set this you may want to add PreAnchored to the config)

geniFlags :: [Flag]

getFlagP :: (Typeable f, Typeable x) => (x -> f) -> Params -> Maybe xSource

getListFlagP :: (Typeable f, Typeable x) => ([x] -> f) -> Params -> [x]Source

modifyFlagP :: (Eq f, Typeable f, Typeable x) => (x -> f) -> (x -> x) -> Params -> ParamsSource

setFlagP :: (Eq f, Typeable f, Typeable x) => (x -> f) -> x -> Params -> ParamsSource

hasFlagP :: (Typeable f, Typeable x) => (x -> f) -> Params -> BoolSource

deleteFlagP :: (Typeable f, Typeable x) => (x -> f) -> Params -> ParamsSource

emptyParams :: ParamsSource

The default parameters configuration



:: [OptSection]


-> String

prog name

-> String 

Print out a GenI-style usage message with options divided into sections

basicSections :: [OptSection]Source

optionsSections :: [OptSection]Source

processInstructions :: Params -> IO ParamsSource

Update the internal instructions list, test suite and case according to the contents of an instructions file.

Basic approach

  • we always have instructions: if no instructions file, is specified we infer virtual instructions from the test suite flag * the testsuite and testcase flags are focusing tools, they pick out a subset from the instructions

optionsForStandardGenI :: [OptDescr Flag]Source

Uses the GetOpt library to process the command line arguments. Note that we divide them into basic and advanced usage.

noArg :: forall f. (Eq f, Typeable f) => (() -> f) -> ArgDescr FlagSource



:: forall f x . (Eq f, Typeable f, Eq x, Typeable x) 
=> (x -> f)


-> (String -> x)

string reader for flag (probably |id| if already a String)

-> String


-> ArgDescr Flag 



:: forall f x . (Eq f, Typeable f, Eq x, Typeable x) 
=> (x -> f)


-> x

default value

-> (String -> x)

string reader (as in reqArg)

-> String


-> ArgDescr Flag 

parseFlagWithParsec :: String -> CharParser () b -> String -> bSource

TODO: This is a horrible and abusive use of error

configration files

class Typeable a

The class Typeable allows a concrete representation of a type to be calculated.


Typeable Bool 
Typeable Char 
Typeable Double 
Typeable Float 
Typeable Int 
Typeable Int8 
Typeable Int16 
Typeable Int32 
Typeable Int64 
Typeable Integer 
Typeable Ordering 
Typeable RealWorld 
Typeable Word 
Typeable Word8 
Typeable Word16 
Typeable Word32 
Typeable Word64 
Typeable () 
Typeable IOException 
Typeable TypeRep 
Typeable Version 
Typeable YamlAnchor 
Typeable YamlNode 
Typeable YamlElem 
Typeable Fd 
Typeable CRLim 
Typeable CTcflag 
Typeable CSpeed 
Typeable CCc 
Typeable CUid 
Typeable CNlink 
Typeable CGid 
Typeable CSsize 
Typeable CPid 
Typeable COff 
Typeable CMode 
Typeable CIno 
Typeable CDev 
Typeable Handle 
Typeable Handle__ 
Typeable E0 
Typeable E1 
Typeable E2 
Typeable E3 
Typeable E6 
Typeable E9 
Typeable E12 
Typeable DataType 
Typeable PatternMatchFail 
Typeable RecSelError 
Typeable RecConError 
Typeable RecUpdError 
Typeable NoMethodError 
Typeable NonTermination 
Typeable NestedAtomically 
Typeable ThreadId 
Typeable BlockedIndefinitelyOnMVar 
Typeable BlockedIndefinitelyOnSTM 
Typeable Deadlock 
Typeable AssertionFailed 
Typeable AsyncException 
Typeable ArrayException 
Typeable ExitCode 
Typeable CChar 
Typeable CSChar 
Typeable CUChar 
Typeable CShort 
Typeable CUShort 
Typeable CInt 
Typeable CUInt 
Typeable CLong 
Typeable CULong 
Typeable CLLong 
Typeable CULLong 
Typeable CFloat 
Typeable CDouble 
Typeable CPtrdiff 
Typeable CSize 
Typeable CWchar 
Typeable CSigAtomic 
Typeable CClock 
Typeable CTime 
Typeable CUSeconds 
Typeable CSUSeconds 
Typeable CIntPtr 
Typeable CUIntPtr 
Typeable CIntMax 
Typeable CUIntMax 
Typeable SomeException 
Typeable ErrorCall 
Typeable ArithException 
Typeable TyCon 
Typeable ByteString 
Typeable ByteString 
Typeable IntSet 
Typeable SourcePos 
Typeable JSValue 
Typeable JSString 
Typeable Text 
Typeable UnicodeException 
Typeable LocalTime 
Typeable ZonedTime 
Typeable TimeOfDay 
Typeable TimeZone 
Typeable UTCTime 
Typeable NominalDiffTime 
Typeable Day 
Typeable UniversalTime 
Typeable DiffTime 
Typeable PolarityAttr 
Typeable PolarityKey 
Typeable GeniVal 
Typeable WeirdFlg 
Typeable GrammarTypeFlg 
Typeable BuilderFlg 
Typeable ViewCmdFlg 
Typeable VersionFlg 
Typeable VerboseModeFlg 
Typeable TimeoutFlg 
Typeable TestSuiteFlg 
Typeable TestInstructionsFlg 
Typeable TestCaseFlg 
Typeable StatsFileFlg 
Typeable NoLoadTestSuiteFlg 
Typeable RootFeatureFlg 
Typeable RankingConstraintsFlg 
Typeable PartialFlg 
Typeable OutputFileFlg 
Typeable OptimisationsFlg 
Typeable MorphInfoFlg 
Typeable MorphCmdFlg 
Typeable MetricsFlg 
Typeable MaxResultsFlg 
Typeable MaxStepsFlg 
Typeable TracesFlg 
Typeable MacrosFlg 
Typeable LexiconFlg 
Typeable InstructionsFileFlg 
Typeable HelpFlg 
Typeable FromStdinFlg 
Typeable EarlyDeathFlg 
Typeable DumpDerivationFlg 
Typeable DetectPolaritiesFlg 
Typeable DisableGuiFlg 
Typeable BatchDirFlg 
Typeable Flag 
Typeable GrammarType 
Typeable BuilderType 
Typeable Optimisation 
Typeable LexEntry 
Typeable GType 
Typeable Ptype 
Typeable TagElem 
Typeable TagSite 
Typeable MNAME 
Typeable UninflectedDisjunction 
Typeable SimpleGuiItem 
Typeable BadInputException 
Typeable Timeout 
Typeable MNAME 
(Typeable1 s, Typeable a) => Typeable (s a)

One Typeable instance for all Typeable1 instances