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

Safe HaskellNone

NLP.HistPL.Analyse

Contents

Description

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

Synopsis

Tokenization

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 characters are treated as token ending markers.

rmHyphen :: Text -> TextSource

Remove all instances of the "-\n" string.

Analysis

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 the left elements of the input list.

JSON

data JConf Source

JSON serialization configuration. Depending on the configuration, different parts of the result will be converted to a JSON format.

Constructors

JConf 

Fields

showCont :: ShowCont

When to show cont. interpretations.

showDefs :: Bool

Show definitions?

Instances

data ShowCont Source

When contemporary interpretations should be shown.

defaultJConf :: JConfSource

Default JSON serialization configuration.

jsonAna :: JConf -> [Either Token Other] -> ValueSource

Build JSON value from a list of analysed sentences.