concraft-0.9.4: Morphological disambiguation based on constrained CRFs

Safe HaskellNone
LanguageHaskell98

NLP.Concraft.Morphosyntax

Contents

Description

Types and functions related to the morphosyntax data layer.

Synopsis

Segment

data Seg w t Source

A segment parametrized over a word type and a tag type.

Constructors

Seg 

Fields

word :: w

A word represented by the segment. Typically it will be an instance of the Word class.

tags :: WMap t

A set of interpretations. To each interpretation a weight of appropriateness within the context is assigned.

Instances

(Show w, Show t) => Show (Seg w t) 
ToJSON w => ToJSON (Seg w Text) 
FromJSON w => FromJSON (Seg w Text) 
Word w => Word (Seg w t) 

mapSeg :: Ord b => (a -> b) -> Seg w a -> Seg w b Source

Map function over segment tags.

interpsSet :: Seg w t -> Set t Source

Interpretations of the segment.

interps :: Seg w t -> [t] Source

Interpretations of the segment.

Word class

class Word a where Source

Methods

orth :: a -> Text Source

Orthographic form.

oov :: a -> Bool Source

Out-of-vocabulary (OOV) word.

Instances

Word w => Word (Seg w t) 

Sentence

type Sent w t = [Seg w t] Source

A sentence.

mapSent :: Ord b => (a -> b) -> Sent w a -> Sent w b Source

Map function over sentence tags.

data SentO w t Source

A sentence with original, textual representation.

Constructors

SentO 

Fields

segs :: Sent w t
 
orig :: Text
 

Instances

(Show w, Show t) => Show (SentO w t) 

mapSentO :: Ord b => (a -> b) -> SentO w a -> SentO w b Source

Map function over sentence tags.

Weighted collection

data WMap a Source

A set with a non-negative weight assigned to each of its elements.

Instances

Eq a => Eq (WMap a) 
Ord a => Ord (WMap a) 
Show a => Show (WMap a) 
Binary a => Binary (WMap a) 

mapWMap :: Ord b => (a -> b) -> WMap a -> WMap b Source

Map function over weighted collection elements.

mkWMap :: Ord a => [(a, Double)] -> WMap a Source

Make a weighted collection. Negative elements will be ignored.