hist-pl-0.1.0: Umbrella package for the historical dictionary of Polish

Safe HaskellNone

NLP.HistPL.Analyse

Description

The module provides functions for dictionary-driven analysis of the input text.

Synopsis

Documentation

data Token Source

A token is an element of the analysis result.

Constructors

Token 

Fields

orth :: Text

Orthographic form.

hist :: [(LexEntry, Code)]

Historical interpretations.

cont :: [[Interp]]

Contemporary interpretations.

Instances

data Other Source

A punctuation or a space.

Constructors

Pun Text

Punctuation

Space Text

Space

Instances

tokenize :: Text -> [Either Text Other]Source

Perform simple tokenization -- spaces and punctuation are treated as token ending markers.

anaText :: HistPL -> Text -> IO [Either Token Other]Source

Analyse the text.

anaWord :: HistPL -> Text -> IO TokenSource

Analyse the word.

mapL :: (Functor m, Monad m) => (a -> m a') -> [Either a b] -> m [Either a' b]Source

Map the monadic function over left elements.

showAna :: [Either Token Other] -> TextSource

Show analysed text.