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

Safe HaskellNone

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 Source

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?)

Guided

guided realisation (needs polarity filtering)

type Instruction = (FilePath, Maybe [Text])Source

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

data BuilderType Source

The tree assembly algorithm we want to use

data GrammarType Source

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 Source

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 whereSource

Methods

flags :: x -> [Flag]Source

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

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 -> BoolSource

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

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

modifyFlagSource

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 -> flagsSource

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

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

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

updateFlagsSource

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 Source

Constructors

HelpFlg () 

newtype PartialFlg Source

Constructors

PartialFlg () 

newtype TestCaseFlg Source

Constructors

TestCaseFlg Text 

newtype VersionFlg Source

Constructors

VersionFlg () 

newtype WeirdFlg Source

Constructors

WeirdFlg String