partage-0.1.0.1: Parsing factorized

Safe HaskellNone
LanguageHaskell2010

NLP.Partage.Auto

Contents

Description

Abstract implementation of an automaton (or a set of automata, in general). Auto provides a minimal interface needed to use automata in parsing and thus allows to use one of the concrete implementations provided by the library:

Synopsis

Automata

data Auto a Source

Minimal automaton implementation. Multiple roots are allowed in order to account for list implementation of an automaton.

Constructors

Auto 

Fields

roots :: Set ID

Set of automata roots

follow :: ID -> a -> Maybe ID

Follow a transition with the given symbol from the given node

edges :: ID -> [(a, ID)]

List of outgoing edges (transitions)

data Edge a Source

A datatype used to distinguish head non-terminals from body non-terminals in automata-based grammar representation.

Constructors

Head a 
Body a 

Instances

Eq a => Eq (Edge a) Source 
Ord a => Ord (Edge a) Source 
Show a => Show (Edge a) Source 

type GramAuto n t = Auto (Edge (Lab n t)) Source

Automaton type specialized to represent grammar rules.

Utilities

allIDs :: Ord a => Auto a -> Set ID Source

Extract the set of underlying IDs.

allEdges :: Ord a => Auto a -> [(ID, a, ID)] Source

Return the list of automaton transitions.