ace-0.6: Attempto Controlled English parser and printer

Safe HaskellSafe
LanguageHaskell98

ACE.Types.Syntax

Description

Types for the syntax tree.

Synopsis

Documentation

data Specification #

Specifications consist of a sentence coordination followed by a period and optionally one ore more subsequent specifications.

data SentenceCoord #

Sentences can be coordinated by and and or. And refers to the logical conjunction, while or de-notes the logical disjunction. The logical conjunction has a higher precedence than the disjunction.

Both connectors are right-associative. The expression

A or B and C or D

is therefore ordered like

A ∨ ((B ∧ C) ∨ D)

To enable more combinations, we have introduced comma-and and comma-or. These expressions reverse the order of precedence. To achieve the order

A ∨ (B ∧ (C ∨ D))

we can write

A, or B, and C or D

A sentence coordination in general consists of a sentence coordination of a lower level (thus ensuring right-associativity) optionally followed by the respective connector and a sentence coordination of the same level.

data TopicalizedSentence #

A topicalized sentence can start with an existential topic or a universal topic. It needs, however, not be topicalized at all but can just be an ordinary composite sentence.

Constructors

TopicalizedSentenceExistential !ExistentialTopic !(Maybe SentenceCoord)

Example: "There is a card such that the code of the card is valid."

TopicalizedSentenceUniversal !UniversalTopic !SentenceCoord

Example: "For every code there is a card such that the code belongs to it."

TopicalizedSentenceComposite !CompositeSentence

Example: "Homer is a man."

data Sentence #

Constructors

Sentence !NPCoord !VPCoord 

data N' #

Modified noun.

Instances

Eq N' # 

Methods

(==) :: N' -> N' -> Bool #

(/=) :: N' -> N' -> Bool #

Show N' # 

Methods

showsPrec :: Int -> N' -> ShowS #

show :: N' -> String #

showList :: [N'] -> ShowS #

data NP #

Noun-phrase.

Instances

Eq NP # 

Methods

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

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

Show NP # 

Methods

showsPrec :: Int -> NP -> ShowS #

show :: NP -> String #

showList :: [NP] -> ShowS #

data N #

A noun.

Constructors

N !Text 

Instances

Eq N # 

Methods

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

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

Show N # 

Methods

showsPrec :: Int -> N -> ShowS #

show :: N -> String #

showList :: [N] -> ShowS #

data PP #

Constructors

PP !Preposition !NPCoord 

Instances

Eq PP # 

Methods

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

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

Show PP # 

Methods

showsPrec :: Int -> PP -> ShowS #

show :: PP -> String #

showList :: [PP] -> ShowS #

data Variable #

Constructors

Variable !Text 

data VPCoord #

Constructors

VPCoord' !VP !Coord !VPCoord 
VPCoordVP !VP 

Instances

data VP #

Constructors

VP !V' 
VPNeg !Copula !V' 

Instances

Eq VP # 

Methods

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

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

Show VP # 

Methods

showsPrec :: Int -> VP -> ShowS #

show :: VP -> String #

showList :: [VP] -> ShowS #

data V' #

Constructors

V' !(Maybe AdverbCoord) !ComplV ![VModifier] 

Instances

Eq V' # 

Methods

(==) :: V' -> V' -> Bool #

(/=) :: V' -> V' -> Bool #

Show V' # 

Methods

showsPrec :: Int -> V' -> ShowS #

show :: V' -> String #

showList :: [V'] -> ShowS #

data APCoord #

Instances

data APgrad #

Constructors

APgradAPThan !AP !NPCoord 
APgradAP !AP 

Instances

Eq APgrad # 

Methods

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

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

Show APgrad # 

data AP #

Instances

Eq AP # 

Methods

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

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

Show AP # 

Methods

showsPrec :: Int -> AP -> ShowS #

show :: AP -> String #

showList :: [AP] -> ShowS #

data Compl #

Constructors

ComplNP !NPCoord 
ComplPP !PP 

Instances

Eq Compl # 

Methods

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

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

Show Compl # 

Methods

showsPrec :: Int -> Compl -> ShowS #

show :: Compl -> String #

showList :: [Compl] -> ShowS #

data Adverb #

Constructors

Adverb !Text 

Instances

Eq Adverb # 

Methods

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

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

Show Adverb # 

data NumberP #

Instances

data Aux #

Constructors

Do

"do"

Does

"does"

Instances

Eq Aux # 

Methods

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

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

Show Aux # 

Methods

showsPrec :: Int -> Aux -> ShowS #

show :: Aux -> String #

showList :: [Aux] -> ShowS #

data Coord #

Constructors

And

"and"

Or

"or"

Instances

Eq Coord # 

Methods

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

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

Show Coord # 

Methods

showsPrec :: Int -> Coord -> ShowS #

show :: Coord -> String #

showList :: [Coord] -> ShowS #

data Copula #

Constructors

Is

"is"

Are

"are"

Instances

Eq Copula # 

Methods

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

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

Show Copula # 

data Determiner #

Constructors

The

"the"

A

"a"

An

"an"

Some

"some"

No

"no"

EveryEach

"every" / "each"

All

"all"

NotEvery

"not every"

NotEach

"not each"

NotAll

"not all"

Which

"which"

data PossessivePronoun #

Constructors

His

"his"

Her

"her"

HisHer

"his/her"

Its

"its"

Their

"their"

HisHerOwn

"his own" "her own" "his/her own"

ItsOwn

"its own"

TheirOwn

"their own"

Whose

"whose"