Copyright | (c) 2018-20202022-2023 Dakotah Lambert |
---|---|
License | MIT |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module provides methods to convert automata to and from various formats.
Synopsis
- from :: Importable i => Type i -> String -> FSA Integer String
- fromE :: Importable i => Type i -> String -> Either String (FSA Integer String)
- to :: (Ord n, Ord e, Show n, Show e, Exportable x) => Type x -> FSA n e -> String
- type Type t = t -> t
- newtype Dot = Dot Dot
- newtype EggBox = EggBox EggBox
- newtype SyntacticOrder = SyntacticOrder SyntacticOrder
- newtype Jeff = Jeff Jeff
- newtype Pleb = Pleb Pleb
- newtype ATT = ATT ATT
- newtype ATTO = ATTO ATTO
- newtype Corpus = Corpus Corpus
- formatSet :: Show n => Set n -> String
- transliterate :: Ord n => FSA n String -> FSA n String
- transliterateString :: String -> String
- untransliterate :: Ord n => FSA n String -> FSA n String
- untransliterateString :: String -> String
- class Importable t where
- class Exportable t where
Conversions
In the following definitions,
(Type t)
is shorthand for (String -> t)
.
Formats
We use types to create a bit of magic in order to read and write automata in various formats.
The GraphViz Dot format.
The egg-box in GraphViz Dot format.
newtype SyntacticOrder #
A Hasse diagram of the syntactic order.
Since: 1.1
Instances
Exportable SyntacticOrder # | |
Defined in LTK.Porters fromFSA :: (Ord n, Ord e, Show n, Show e) => (SyntacticOrder -> SyntacticOrder) -> FSA n e -> String # |
Jeff's format.
The format defined by the (P)iecewise / (L)ocal (E)xpression (B)uilder.
The AT&T finite-state transducer format, input projection
Since: 0.3
The AT&T finite-state transducer format, output projection
Since: 0.3
A corpus of strings
Since: 0.3
Miscellaneous
transliterate :: Ord n => FSA n String -> FSA n String #
Automata in Jeff's format use edge labels of the form “w0.s1”. This function converts the edge labels of an automaton from this form to the “L`” form that we tend to use.
transliterateString :: String -> String #
See transliterate
. This function operates directly on the
representation of the edge label.
untransliterate :: Ord n => FSA n String -> FSA n String #
The inverse of transliterate
.
untransliterateString :: String -> String #
The inverse of transliterateString
.
class Importable t where #
A type that can be read and turned into an FSA
.
Instances
class Exportable t where #
A type that can be written from an FSA
.
Instances
Exportable ATT # | |
Exportable ATTO # | |
Exportable Dot # | |
Exportable EggBox # | |
Exportable Jeff # | |
Exportable SyntacticOrder # | |
Defined in LTK.Porters fromFSA :: (Ord n, Ord e, Show n, Show e) => (SyntacticOrder -> SyntacticOrder) -> FSA n e -> String # |