concraft-pl-0.1.0: Morphological tagger for Polish

Safe HaskellNone

NLP.Concraft.Polish.Morphosyntax

Contents

Description

Morphosyntax data layer in Polish.

Synopsis

Tag

type Tag = TextSource

A textual representation of a morphosyntactic tag.

Segment

data Seg t Source

A segment.

Constructors

Seg 

Fields

word :: Word
 
interps :: Map (Interp t) Bool

Interpretations of the token, each interpretation annotated with a disamb Boolean value (if True, the interpretation is correct within the context).

Instances

Eq t => Eq (Seg t) 
Ord t => Ord (Seg t) 
Show t => Show (Seg t) 
(Ord t, Binary t) => Binary (Seg t) 

data Word Source

A word.

Constructors

Word 

Fields

orth :: Text
 
space :: Space
 
known :: Bool
 

data Interp t Source

An interpretation. TODO: Should we allow base to be Nothing?

Constructors

Interp 

Fields

base :: Maybe Text
 
tag :: t
 

Instances

Eq t => Eq (Interp t) 
Ord t => Ord (Interp t) 
Show t => Show (Interp t) 
(Ord t, Binary t) => Binary (Interp t) 

data Space Source

No space, space or newline. TODO: Perhaps we should use a bit more informative data type.

Constructors

None 
Space 
NewLine 

Sentence

type Sent t = [Seg t]Source

A sentence.

data SentO t Source

A sentence.

Constructors

SentO 

Fields

segs :: [Seg t]
 
orig :: Text
 

restore :: Sent t -> TextSource

Restore textual representation of a sentence. The function is not very accurate, it could be improved if we enrich representation of a space.

withOrig :: Sent t -> SentO tSource

Use restore to translate Sent to a SentO.

Conversion

packSegTag :: Tagset -> Seg Tag -> Seg Word TagSource

Convert a segment to a segment from a core library.

packSeg :: Ord a => Seg a -> Seg Word aSource

Convert a segment to a segment from a core library.

packSentTag :: Tagset -> Sent Tag -> Sent Word TagSource

Convert a sentence to a sentence from a core library.

packSentTagO :: Tagset -> SentO Tag -> SentO Word TagSource

Convert a sentence to a sentence from a core library.

packSent :: Ord a => Sent a -> Sent Word aSource

Convert a sentence to a sentence from a core library.

embedSent :: Ord a => Sent a -> [a] -> Sent aSource

Embed tags in a sentence.