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

Safe HaskellNone
LanguageHaskell2010

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

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

Instances

Eq Flag Source # 

Methods

(==) :: Flag -> Flag -> Bool #

(/=) :: Flag -> Flag -> Bool #

HasFlags [Flag] Source # 

Methods

flags :: [Flag] -> [Flag] Source #

onFlags :: ([Flag] -> [Flag]) -> [Flag] -> [Flag] Source #

class HasFlags x where Source #

Minimal complete definition

flags, onFlags

Methods

flags :: x -> [Flag] Source #

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

Instances

HasFlags Params Source #

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

Methods

flags :: Params -> [Flag] Source #

onFlags :: ([Flag] -> [Flag]) -> Params -> Params Source #

HasFlags ProgState Source #

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

HasFlags [Flag] Source # 

Methods

flags :: [Flag] -> [Flag] Source #

onFlags :: ([Flag] -> [Flag]) -> [Flag] -> [Flag] Source #

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

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

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

modifyFlag Source #

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 Source #

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

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

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

updateFlags Source #

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

Instances

newtype MacrosFlg Source #

Constructors

MacrosFlg FilePath 

Instances

newtype TracesFlg Source #

Constructors

TracesFlg FilePath 

Instances

newtype MetricsFlg Source #

Constructors

MetricsFlg [String] 

newtype PartialFlg Source #

Constructors

PartialFlg () 

newtype TimeoutFlg Source #

Constructors

TimeoutFlg Int 

newtype VersionFlg Source #

Constructors

VersionFlg () 

newtype WeirdFlg Source #

Constructors

WeirdFlg String 

Instances