ace-0.6: Attempto Controlled English parser and printer

Safe HaskellSafe-Inferred
LanguageHaskell98

ACE.Parsers

Description

Parsers for ACE syntax types.

Synopsis

Documentation

data ACEParser s m Source

Parser configuration.

Constructors

ACE 

Fields

aceIntransitiveAdjective :: ParsecT s (ACEParser s m) m Text

Parser for intransitive adjectives.

aceTransitiveAdjective :: ParsecT s (ACEParser s m) m Text

Parser for transitive adjectives.

aceNoun :: ParsecT s (ACEParser s m) m Text

Parser for nouns.

acePreposition :: ParsecT s (ACEParser s m) m Text

Parser for prepositions.

aceVariable :: ParsecT s (ACEParser s m) m Text

Parser for variables.

aceProperName :: ParsecT s (ACEParser s m) m Text

Parser for proper names.

aceAdverb :: ParsecT s (ACEParser s m) m Text

Parser for adverbs.

aceIntransitiveVerb :: ParsecT s (ACEParser s m) m Text

Parser for intransitive verbs.

acePhrasalTransitiveV :: ParsecT s (ACEParser s m) m Text

Parser for phrasal transitive verbs.

acePhrasalDistransitiveV :: ParsecT s (ACEParser s m) m Text

Parser for phrasal distransitive verbs.

aceTransitiveVerb :: ParsecT s (ACEParser s m) m Text

Parser for transitive verbs.

aceDistransitiveVerb :: ParsecT s (ACEParser s m) m Text

Parser for distransitive verbs.

acePhrasalParticle :: ParsecT s (ACEParser s m) m Text

Parser for phrasal particles.

acePhrasalIntransitiveV :: ParsecT s (ACEParser s m) m Text

Parser for phrasal intransitive verbs.

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

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 Source

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

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

Coordinated sentence, by: or

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

Coordinated sentence, by: and

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

Coordinated sentence, by: or

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

Coordinated sentence, by: and

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

A topicalized sentence.

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

A universally quantified topic.

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

A negated sentence: it is not the case that sentenceCoord

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

Sentence: npCoord vpCoord: a cat meows

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

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

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

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

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

A preposition. Configured by acePreposition.

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

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

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

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

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

Apposition: either a variable or a quotation.

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

A apposition coordination: X and Y.

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

A prepositional noun phrase coordination.

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

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

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

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 Source

Unmarked noun phrase coordination: some thing and a thing.

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

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

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

A coordinated noun phrase. See npCoordX.

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

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

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

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 Source

An "of" prepositional phrase: of the bank

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

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

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

A variable. Customized by aceVariable.

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

A proper name. Customized by aceProperName.

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

Some quotation: "foo bar"

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

A noun. Customized by aceNoun.

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

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 Source

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

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 Source

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 Source

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

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

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 Source

Genitive specifier: a, 1, some, his

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

A ' or 's saxon genitive.

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

Possessive pronoun coordination: his and her

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

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

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

A complemented copula: is valid

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

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

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

A distransitive complemented verb: gives a card to a customer

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

A complemented phrasal transitive verb: gives away a code

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

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

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

Complemented transitive verb: inserts a card

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

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

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

A phrasal transitive verb: give away a thing

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

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

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

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

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

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 Source

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 Source

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 Source

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 Source

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 Source

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 Source

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 Source

Some intransitive verb: walks

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

Some transitive verb: inserts

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

Some distransitive verb: inserts

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

Adverb coordination: quickly and hastily and manually

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

Adverb: quickly

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

Adjective coordination: correct and green

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

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 Source

Transitive adjective: correct, green, valid

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

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

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

A number phrase: more than 5

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

Do/does.

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

Pronouns.

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

And/or.

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

Is/are.

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

A distributive global quantor: for each of

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

A distributive marker: each of

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

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

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

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

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

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