Safe Haskell | None |
---|
- type Codec a b = (AtomCodec a, AtomCodec b)
- type CodecM a b c = Codec (Codec a b) c
- encodeWord'Cu :: Ord a => Word a -> CodecM a b X
- encodeWord'Cn :: Ord a => Word a -> CodecM a b X
- encodeSent'Cu :: Ord a => Sent a -> CodecM a b Xs
- encodeSent'Cn :: Ord a => Sent a -> CodecM a b Xs
- encodeSent :: Ord a => Codec a b -> Sent a -> Xs
- encodeWordL'Cu :: (Ord a, Ord b) => WordL a b -> CodecM a b (X, Y)
- encodeWordL'Cn :: (Ord a, Ord b) => Int -> WordL a b -> CodecM a b (X, Y)
- encodeSentL'Cu :: (Ord a, Ord b) => SentL a b -> CodecM a b (Xs, Ys)
- encodeSentL'Cn :: (Ord a, Ord b) => b -> SentL a b -> CodecM a b (Xs, Ys)
- encodeSentL :: (Ord a, Ord b) => b -> Codec a b -> SentL a b -> (Xs, Ys)
- decodeLabel :: Ord b => Codec a b -> Lb -> b
- decodeLabels :: Ord b => Codec a b -> [Lb] -> [b]
- mkCodec :: (Ord a, Ord b) => [SentL a b] -> (Codec a b, [(Xs, Ys)])
- encodeData :: Ord a => Codec a b -> [Sent a] -> [Xs]
- encodeDataL :: (Ord a, Ord b) => b -> Codec a b -> [SentL a b] -> [(Xs, Ys)]
Documentation
type Codec a b = (AtomCodec a, AtomCodec b)Source
A codec. The first component is used to encode observations of type a, the second one is used to encode labels of type b.
type CodecM a b c = Codec (Codec a b) cSource
Type synonym for the codec monad. It is important to notice that by a
codec we denote here a structure of two AtomCodec
s while in the
monad-codec package it denotes a monad.
encodeWord'Cn :: Ord a => Word a -> CodecM a b XSource
Encode the word and do *not* update the codec.
encodeSent'Cn :: Ord a => Sent a -> CodecM a b XsSource
Encode the sentence and do *not* update the codec.
encodeWordL'Cu :: (Ord a, Ord b) => WordL a b -> CodecM a b (X, Y)Source
Encode the labeled word and update the codec.
encodeWordL'Cn :: (Ord a, Ord b) => Int -> WordL a b -> CodecM a b (X, Y)Source
Encodec the labeled word and do *not* update the codec. If the label is not in the codec, use the default value.
encodeSentL'Cu :: (Ord a, Ord b) => SentL a b -> CodecM a b (Xs, Ys)Source
Encode the labeled sentence and update the codec.
encodeSentL'Cn :: (Ord a, Ord b) => b -> SentL a b -> CodecM a b (Xs, Ys)Source
Encode the labeled sentence and do *not* update the codec. Substitute the default label for any label not present in the codec.
encodeSentL :: (Ord a, Ord b) => b -> Codec a b -> SentL a b -> (Xs, Ys)Source
Encode the labeled sentence with the given codec. Substitute the default label for any label not present in the codec.
decodeLabel :: Ord b => Codec a b -> Lb -> bSource
Decode the label.
decodeLabels :: Ord b => Codec a b -> [Lb] -> [b]Source
Decode the sequence of labels.