concraft-0.8.2: Morphological disambiguation based on constrained CRFs

Safe HaskellNone

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 bSource

Map function over segment tags.

interpsSet :: Seg w t -> Set tSource

Interpretations of the segment.

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

Interpretations of the segment.

Word class

class Word a whereSource

Methods

orth :: a -> TextSource

Orthographic form.

oov :: a -> BoolSource

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 bSource

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 bSource

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) 

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

Map function over weighted collection elements.

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

Make a weighted collection. Negative elements will be ignored.