Safe Haskell | None |
---|

Internal core data types.

- data X o t
- type Xs o t = Vector (X o t)
- mkX :: (Ord o, Ord t) => [o] -> [t] -> X o t
- unX :: X o t -> [o]
- unR :: X o t -> [t]
- data Y t
- type Ys t = Vector (Y t)
- mkY :: Ord t => [(t, Double)] -> Y t
- unY :: Y t -> [(t, Double)]
- lbAt :: X o t -> LbIx -> t
- lbOn :: Xs o t -> Int -> LbIx -> Maybe t
- lbNum :: Xs o t -> Int -> Int
- lbIxs :: Xs o t -> Int -> [LbIx]
- newtype FeatIx = FeatIx {}
- type LbIx = Int
- data AVec a
- mkAVec :: Ord a => [a] -> AVec a
- data AVec2 a b
- mkAVec2 :: Ord a => [(a, b)] -> AVec2 a b

# Input element (word)

A word represented by a list of its observations and a list of its potential label interpretations.

# Output element (choice)

Vector of chosen labels together with corresponding probabilities.

# Indexing

lbOn :: Xs o t -> Int -> LbIx -> Maybe tSource

Potential label at the given position and at the given index. Return Nothing for positions outside the domain.

lbNum :: Xs o t -> Int -> IntSource

Number of potential labels at the given position of the sentence. Function extended to indices outside the positions' domain.

lbIxs :: Xs o t -> Int -> [LbIx]Source

List of label indices at the given position. Function extended to indices outside the positions' domain.

# Feature index

A feature index. To every model feature a unique index is assigned.

# Auxiliary

An ascending vector of distinct elements.

mkAVec :: Ord a => [a] -> AVec aSource

Smart AVec constructor which ensures that the underlying vector is strictly ascending.

An ascending vector of distinct elements with respect
to `fst`

values.