ace-0.5: Attempto Controlled English parser and printer

Safe HaskellNone

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 mSource

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 SpecificationSource

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

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

Coordinated sentence, by: or

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

Coordinated sentence, by: and

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

Coordinated sentence, by: or

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

Coordinated sentence, by: and

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

A topicalized sentence.

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

A universally quantified topic.

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

A negated sentence: it is not the case that sentenceCoord

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

Sentence: npCoord vpCoord: a cat meows

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

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

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

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

preposition :: Monad m => ParsecT s (ACEParser s m) m PrepositionSource

A preposition. Configured by acePreposition.

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

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

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

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

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

Apposition: either a variable or a quotation.

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

A apposition coordination: X and Y.

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

A prepositional noun phrase coordination.

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

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 UnmarkedNPCoordSource

Unmarked noun phrase coordination: some thing and a thing.

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

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

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

A coordinated noun phrase. See npCoordX.

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

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

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

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 NPCoordSource

An of prepositional phrase: of the bank

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

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

variable :: Monad m => ParsecT s (ACEParser s m) m VariableSource

A variable. Customized by aceVariable.

properName :: Monad m => ParsecT s (ACEParser s m) m ProperNameSource

A proper name. Customized by aceProperName.

quotation :: Stream s m Token => ParsecT s u m QuotationSource

Some quotation: "foo bar"

n :: Monad m => ParsecT s (ACEParser s m) m NSource

A noun. Customized by aceNoun.

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

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 VPSource

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 VModifierSource

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

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

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 GenitiveSpecifierSource

Genitive specifier: a, 1, some, his

saxonGenitiveMarker :: Stream s m Token => ParsecT s u m SaxonGenitiveMarkerSource

A ' or 's saxon genitive.

possessivePronounCoord :: Stream s m Token => ParsecT s u m PossessivePronounCoordSource

Possessive pronoun coordination: his and her

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

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 ComplVSource

A complemented copula: is valid

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

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

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

A distransitive complemented verb: gives a card to a customer

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

A complemented phrasal transitive verb: gives away a code

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

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

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

Complemented transitive verb: inserts a card

phrasalDistransitiveV :: Monad m => ParsecT s (ACEParser s m) m PhrasalDistransitiveVSource

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

phrasalTransitiveV :: Monad m => ParsecT s (ACEParser s m) m PhrasalTransitiveVSource

A phrasal transitive verb: give away a thing

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

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

complVIV :: Monad m => ParsecT s (ACEParser s m) m ComplVSource

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

complVPI :: Monad m => ParsecT s (ACEParser s m) m ComplVSource

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 PhrasalIntransitiveVSource

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 PhrasalParticleSource

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 CopulaComplSource

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 APCoordSource

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 APgradSource

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 APSource

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 IntransitiveVSource

Some intransitive verb: walks

transitiveV :: Monad m => ParsecT s (ACEParser s m) m TransitiveVSource

Some transitive verb: inserts

distransitiveV :: Monad m => ParsecT s (ACEParser s m) m DistransitiveVSource

Some distransitive verb: inserts

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

Adverb coordination: quickly and hastily and manually

adverb :: Monad m => ParsecT s (ACEParser s m) m AdverbSource

Adverb: quickly

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

Adjective coordination: correct and green

intransitiveAdjective :: Monad m => ParsecT s (ACEParser s m) m IntransitiveAdjectiveSource

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 TransitiveAdjectiveSource

Transitive adjective: correct, green, valid

determiner :: Stream s m Token => ParsecT s u m DeterminerSource

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

numberP :: Stream s m Token => ParsecT s u m NumberPSource

A number phrase: more than 5

aux :: Stream s m Token => ParsecT s u m AuxSource

Do/does.

coord :: Stream s m Token => ParsecT s u m CoordSource

And/or.

copula :: Stream s m Token => ParsecT s u m CopulaSource

Is/are.

distributiveGlobalQuantor :: Stream s m Token => ParsecT s u m DistributiveGlobalQuantorSource

A distributive global quantor: for each of

distributiveMarker :: Stream s m Token => ParsecT s u m DistributiveMarkerSource

A distributive marker: each of

generalizedQuantor :: Stream s m Token => ParsecT s u m GeneralizedQuantorSource

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

possessivePronoun :: Stream s m Token => ParsecT s u m PossessivePronounSource

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

universalGlobalQuantor :: Stream s m Token => ParsecT s u m UniversalGlobalQuantorSource

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