Copyright | (c) 2019-2020 Dakotah Lambert |
---|---|
License | MIT |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
A generic implementation of Jeff Heinz's "String Extension Learning". For details, see https://www.aclweb.org/anthology/P10-1092
Since: 0.3
Synopsis
- class Grammar g where
- learn :: (Grammar g, Ord b, Collapsible s) => (a -> g b) -> s (Maybe a) -> g b
- augmentSE :: (Grammar g, Ord b, Collapsible s) => (a -> g b) -> g b -> s (Maybe a) -> g b
- isRecognizedBy :: (Grammar g, Ord b) => (a -> g b) -> g b -> a -> Bool
Documentation
class Grammar g where Source #
A grammar is a representation of a mechanism by which one can determine whether or not a given object is in a given set.
genFSA :: (NFData a, Ord a) => g a -> FSA Integer a Source #
augmentG :: Ord a => g a -> g a -> g a Source #
learn :: (Grammar g, Ord b, Collapsible s) => (a -> g b) -> s (Maybe a) -> g b Source #
Construct a grammar from a finite initial segment of a positive text. The function argument \(f\) should be such that if \(G=f(L)\) and \(f(w)\in G\) then \(w\in L\). In order to be able to learn the empty set, the text argument allows for time points at which no data is provided.