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

Safe HaskellSafe-Infered

NLP.GenI.Flag

Description

Internal representation of GenI configuration options, typically passed in through the command line or via the GUI.

We don't yet use the record based approach, or something like cmdargs because our use case involves

  • sharing lots of options between different programs (batch processing, gui, server)
  • supporting library users who want to build GenI-like applications that share a good chunk of our flag set, and add configuration options of their own.

What we have is fairly clunky, but it seems to be quite flexible for that need.

Synopsis

Documentation

data Optimisation

Requested optimisations

At the time of this writing (2012-08-21), this is fairly sparse as a lot of proposed optimisations have just been absorbed into GenI as mandatory things.

Constructors

PolOpts

all polarity-related optimisations

AdjOpts

all adjunction-related optimisations

Polarised

polarity filtering

NoConstraints

ignore literal constraints (pessimisation?)

type Instruction = (FilePath, Maybe [Text])

A test suite and any test cases within that we want to pick out

data BuilderType

The tree assembly algorithm we want to use

data GrammarType

What kind of elementary trees we're getting. The typical use case is to provide tree schemata with GeniHand (which then get anchored into the lexicon to give us elmentary trees). You can also have precompiled trees hardcoded into your GenI-like program, or read preanchored elementary trees from somewhere else.

Constructors

GeniHand

geni's text format

PreCompiled

built into geni, no parsing needed

PreAnchored

lexical selection already done

data Flag

Flags are GenI's internal representation of command line arguments. We use phantom existential types (?) for representing GenI flags. This makes it simpler to do things such as ``get the value of the MacrosFlg'' whilst preserving type safety (we always know that MacrosFlg is associated with String). The alternative would be writing getters and setters for each flag, and that gets really boring after a while.

Constructors

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

Instances

class HasFlags x where

Methods

flags :: x -> [Flag]

onFlags :: ([Flag] -> [Flag]) -> x -> x

Instances

HasFlags Params

Note that this affects the geniFlags; we assume the morph flags are not our business

HasFlags ProgState

Note that this affects the geniFlags; we assume the morph flags are not our business

HasFlags [Flag] 

isFlag :: (Typeable f, Typeable x) => (x -> f) -> Flag -> Bool

hasFlag :: (Typeable f, Typeable x, HasFlags flags) => (x -> f) -> flags -> Bool

deleteFlag :: (Typeable f, Typeable x, HasFlags flags) => (x -> f) -> flags -> flags

modifyFlag

Arguments

:: (Eq f, Typeable f, Typeable x, HasFlags flags) 
=> (x -> f)

flag constructor

-> (x -> x) 
-> flags 
-> flags 

This only has an effect if the flag is set

setFlag :: (Eq f, Typeable f, Typeable x, HasFlags flags) => (x -> f) -> x -> flags -> flags

getFlag :: (Typeable f, Typeable x, HasFlags flags) => (x -> f) -> flags -> Maybe x

getAllFlags :: (Typeable f, Typeable x, HasFlags flags) => (x -> f) -> flags -> [x]

getListFlag :: (Typeable f, Typeable x, HasFlags flags) => ([x] -> f) -> flags -> [x]

updateFlags

Arguments

:: HasFlags flags 
=> flags

new

-> flags

old

-> flags 

updateFlags new old takes the flags from new plus any from old that aren't mentioned in it

newtype HelpFlg

Constructors

HelpFlg () 

newtype LexiconFlg

Constructors

LexiconFlg FilePath 

newtype MacrosFlg

Constructors

MacrosFlg FilePath 

newtype TracesFlg

Constructors

TracesFlg FilePath 

newtype MetricsFlg

Constructors

MetricsFlg [String] 

newtype PartialFlg

Constructors

PartialFlg () 

newtype TestCaseFlg

Constructors

TestCaseFlg Text 

newtype TimeoutFlg

Constructors

TimeoutFlg Int 

newtype VersionFlg

Constructors

VersionFlg () 

newtype ViewCmdFlg

Constructors

ViewCmdFlg String 

newtype WeirdFlg

Constructors

WeirdFlg String