ace-0.6: Attempto Controlled English parser and printer

Safe HaskellSafe
LanguageHaskell98

ACE.Parsers

Description

Parsers for ACE syntax types.

Synopsis

Documentation

data ACEParser s m #

Parser configuration.

Constructors

ACE 

Fields

defaultACEParser :: Stream s m Token => ACEParser s m #

A default ACE parser configuration. Just fills in all the parsers as blanks: <noun>, <prep>, etc.

specification :: Stream s m Token => ParsecT s (ACEParser s m) m Specification #

Some specification. A sentenceCoord followed by a period, and optionally another specification.

sentenceCoord :: Stream s m Token => ParsecT s (ACEParser s m) m SentenceCoord #

Coordinated sentence, by: or

sentenceCoord_1 :: Stream s m Token => ParsecT s (ACEParser s m) m SentenceCoord_1 #

Coordinated sentence, by: and

sentenceCoord_2 :: Stream s m Token => ParsecT s (ACEParser s m) m SentenceCoord_2 #

Coordinated sentence, by: or

sentenceCoord_3 :: Stream s m Token => ParsecT s (ACEParser s m) m SentenceCoord_3 #

Coordinated sentence, by: and

topicalizedSentence :: Stream s m Token => ParsecT s (ACEParser s m) m TopicalizedSentence #

A topicalized sentence.

universalTopic :: Stream s m Token => ParsecT s (ACEParser s m) m UniversalTopic #

A universally quantified topic.

negatedSentence :: Stream s m Token => ParsecT s (ACEParser s m) m NegatedSentence #

A negated sentence: it is not the case that sentenceCoord

sentence :: Stream s m Token => ParsecT s (ACEParser s m) m Sentence #

Sentence: npCoord vpCoord: a cat meows

existentialTopic :: Stream s m Token => ParsecT s (ACEParser s m) m ExistentialTopic #

Existential topic, a existentialGlobalQuantor and a npCoord: there is a chair

specifier :: Stream s m Token => ParsecT s (ACEParser s m) m Specifier #

A noun specifier: "a", "some", "1", "proper-name's".

preposition :: Monad m => ParsecT s (ACEParser s m) m Preposition #

A preposition. Configured by acePreposition.

genitiveTail :: Stream s m Token => ParsecT s (ACEParser s m) m GenitiveTail #

A genitive tail: dave's and a dog's

genitiveCoordTail :: Stream s m Token => ParsecT s (ACEParser s m) m GenitiveCoordTail #

A genitive coordination tail: dave's and a dog's

apposition :: Stream s m Token => ParsecT s (ACEParser s m) m Apposition #

Apposition: either a variable or a quotation.

apposCoord :: Stream s m Token => ParsecT s (ACEParser s m) m ApposCoord #

A apposition coordination: X and Y.

pp :: Stream s m Token => ParsecT s (ACEParser s m) m PP #

A prepositional noun phrase coordination.

relativeClauseCoord :: Stream s m Token => ParsecT s (ACEParser s m) m RelativeClauseCoord #

A relativeClause coordination: person that walks and cake a person made.

n' :: Stream s m Token => Bool -> ParsecT s (ACEParser s m) m N' #

A noun surrounded by optional adjectiveCoord, a noun word n, an optional apposCoord, an optional ofPP, an optional relativeClauseCoord.

unmarkedNPCoord :: Stream s m Token => Bool -> ParsecT s (ACEParser s m) m UnmarkedNPCoord #

Unmarked noun phrase coordination: some thing and a thing.

np :: Stream s m Token => Bool -> ParsecT s (ACEParser s m) m NP #

A noun phrase: a thing, some stuff, the thing.

npCoord :: Stream s m Token => ParsecT s (ACEParser s m) m NPCoord #

A coordinated noun phrase. See npCoordX.

npCoord' :: Stream s m Token => ParsecT s (ACEParser s m) m NPCoord #

A coordinated noun phrase. Inside a relative clause. See npCoordX.

relativeClause :: Stream s m Token => ParsecT s (ACEParser s m) m RelativeClause #

Relative clause: person that walks, cake a person made, cake that a person made, etc.

ofPP :: Stream s m Token => ParsecT s (ACEParser s m) m NPCoord #

An "of" prepositional phrase: of the bank

npCoordX :: Stream s m Token => Bool -> ParsecT s (ACEParser s m) m NPCoord #

A coordinated noun phrase: each of some customers, some customers

variable :: Monad m => ParsecT s (ACEParser s m) m Variable #

A variable. Customized by aceVariable.

properName :: Monad m => ParsecT s (ACEParser s m) m ProperName #

A proper name. Customized by aceProperName.

quotation :: Stream s m Token => ParsecT s u m Quotation #

Some quotation: "foo bar"

n :: Monad m => ParsecT s (ACEParser s m) m N #

A noun. Customized by aceNoun.

vpCoord :: Stream s m Token => ParsecT s (ACEParser s m) m VPCoord #

A verb phrase coordination is either a vp followed by a coord and more vpCoord, or just a vp: walks, walks and runs, bad and is not valid

vp :: Stream s m Token => ParsecT s (ACEParser s m) m VP #

A verb phrase. Can be normal v' or a copula followed by "not" then v': walks, is not valid, etc.

genitiveN' :: Stream s m Token => ParsecT s (ACEParser s m) m GenitiveN' #

A genitive noun: dog, red cat, person 1, movie "We Need to Talk About Kevin".

vModifier :: Stream s m Token => ParsecT s (ACEParser s m) m VModifier #

A verb modifier: quickly and loudly, to a house, from now and forever

adverbialPP :: Stream s m Token => ParsecT s (ACEParser s m) m AdverbialPP #

Adverbial prepositional phrase: until here, by then, until now and then

v' :: Stream s m Token => ParsecT s (ACEParser s m) m V' #

A verb. Consists of an optional adverbCoord, a complemented verb (complV), and one or more verb modifiers.

TODO: I'm not actually sure whether it should be zero-to-1 or zero-to-many. The paper isn't clear what VModifier* means.

genitiveSpecifier :: Stream s m Token => ParsecT s u m GenitiveSpecifier #

Genitive specifier: a, 1, some, his

saxonGenitiveMarker :: Stream s m Token => ParsecT s u m SaxonGenitiveMarker #

A ' or 's saxon genitive.

possessivePronounCoord :: Stream s m Token => ParsecT s u m PossessivePronounCoord #

Possessive pronoun coordination: his and her

genitiveNPCoord :: Stream s m Token => ParsecT s (ACEParser s m) m GenitiveNPCoord #

A genitive noun phrase coordination: dave's, a dog's, a man and a dog's

complV :: Stream s m Token => ParsecT s (ACEParser s m) m ComplV #

A complemented verb. One of complVCopula, complVPDV, complVDisV, complVPV, complVPV', complVTV.

complVCopula :: Stream s m Token => ParsecT s (ACEParser s m) m ComplV #

A complemented copula: is valid

complVPDV :: Stream s m Token => ParsecT s (ACEParser s m) m ComplV #

A distransitive phrasal verb: puts an error down to a customer

complVDisV :: Stream s m Token => ParsecT s (ACEParser s m) m ComplV #

A distransitive complemented verb: gives a card to a customer

complVPV :: Stream s m Token => ParsecT s (ACEParser s m) m ComplV #

A complemented phrasal transitive verb: gives away a code

complVPV' :: Stream s m Token => ParsecT s (ACEParser s m) m ComplV #

A complemented phrasal transitive verb, flipped: gives a code away

complVTV :: Stream s m Token => ParsecT s (ACEParser s m) m ComplV #

Complemented transitive verb: inserts a card

phrasalDistransitiveV :: Monad m => ParsecT s (ACEParser s m) m PhrasalDistransitiveV #

A phrasal distransitive verb: puts an error down to a customer

phrasalTransitiveV :: Monad m => ParsecT s (ACEParser s m) m PhrasalTransitiveV #

A phrasal transitive verb: give away a thing

compl :: Stream s m Token => ParsecT s (ACEParser s m) m Compl #

Complemented non-copula verb, e.g. Mary sees him.

complVIV :: Monad m => ParsecT s (ACEParser s m) m ComplV #

An intransitive verb. Takes no complement. E.g. walks.

complVPI :: Monad m => ParsecT s (ACEParser s m) m ComplV #

A phrasal intransitive verb with a complement, in this case a particle: gets in, sits up.

phrasalIntransitiveV :: Monad m => ParsecT s (ACEParser s m) m PhrasalIntransitiveV #

A phrasal intransitive verb: gives, sits (e.g. gives up, sits down). This is customized by acePhrasalIntransitiveV.

phrasalParticle :: Monad m => ParsecT s (ACEParser s m) m PhrasalParticle #

A phrasal verb particle, e.g. in, up, out (get in, get up, get out). This is customized via acePhrasalParticle.

copulaCompl :: Stream s m Token => ParsecT s (ACEParser s m) m CopulaCompl #

Either a graded adjective coordination ("better than a duck and faster than a mouse"), or a noun phrase coordination ("a goose and an ocelot"), or a prepositional phrase ("to a bucket or a kettle").

apCoord :: Stream s m Token => ParsecT s (ACEParser s m) m APCoord #

A coordination of a graded adjective: "better than a potato and nicer than some bacon"

apGrad :: Stream s m Token => ParsecT s (ACEParser s m) m APgrad #

A graded adjective. Either comparative adjective phrase ("better than a potato"), or a simple adjective phrase (see ap).

ap :: Stream s m Token => ParsecT s (ACEParser s m) m AP #

An adjective phrase. Transitive (fond of Mary, interested in an account) or intransitive (correct, green, valid).

intransitiveV :: Monad m => ParsecT s (ACEParser s m) m IntransitiveV #

Some intransitive verb: walks

transitiveV :: Monad m => ParsecT s (ACEParser s m) m TransitiveV #

Some transitive verb: inserts

distransitiveV :: Monad m => ParsecT s (ACEParser s m) m DistransitiveV #

Some distransitive verb: inserts

adverbCoord :: Stream s m Token => ParsecT s (ACEParser s m) m AdverbCoord #

Adverb coordination: quickly and hastily and manually

adverb :: Monad m => ParsecT s (ACEParser s m) m Adverb #

Adverb: quickly

adjectiveCoord :: Stream s m Token => ParsecT s (ACEParser s m) m AdjectiveCoord #

Adjective coordination: correct and green

intransitiveAdjective :: Monad m => ParsecT s (ACEParser s m) m IntransitiveAdjective #

Intransitive adjective: correct, green, valid

The actual parser for this is provided as aceIntransitiveAdjective in the parser configuration. You can configure this.

transitiveAdjective :: Monad m => ParsecT s (ACEParser s m) m TransitiveAdjective #

Transitive adjective: correct, green, valid

determiner :: Stream s m Token => ParsecT s u m Determiner #

A determiner: the, an, not every, etc.

numberP :: Stream s m Token => ParsecT s u m NumberP #

A number phrase: more than 5

aux :: Stream s m Token => ParsecT s u m Aux #

Do/does.

pronoun :: Stream s m Token => ParsecT s u m Pronoun #

Pronouns.

coord :: Stream s m Token => ParsecT s u m Coord #

And/or.

copula :: Stream s m Token => ParsecT s u m Copula #

Is/are.

distributiveGlobalQuantor :: Stream s m Token => ParsecT s u m DistributiveGlobalQuantor #

A distributive global quantor: for each of

distributiveMarker :: Stream s m Token => ParsecT s u m DistributiveMarker #

A distributive marker: each of

generalizedQuantor :: Stream s m Token => ParsecT s u m GeneralizedQuantor #

A generalized quantor: at most, at least, etc.

possessivePronoun :: Stream s m Token => ParsecT s u m PossessivePronoun #

A possessive pronoun: his, her, his/her.

universalGlobalQuantor :: Stream s m Token => ParsecT s u m UniversalGlobalQuantor #

A universal global quantor: for every/for each, for all.