polh-lexicon-0.1.0: Interface to a historical dictionary of Polish

Safe HaskellNone

NLP.Polh.Binary

Description

The module provides functions for working with the binary representation of the historical dictionary of Polish. The dictionary is stored on a disk but we assume that it doesn't change throughtout the program session so that we can provide the pure interface for dictionary reading and searching.

Synopsis

Documentation

savePolh :: FilePath -> Polh -> IO ()Source

Save the polh dictionary in the empty directory.

loadPolh :: FilePath -> Maybe PolhSource

Load dictionary from a disk in a lazy manner. Return Nothing if the path doesn't correspond to a binary representation of the dictionary.

data PolhM a Source

A PolhM monad is a wrapper over the Polish historical dictionary in a binary form.

Instances

runPolh :: FilePath -> PolhM a -> Maybe aSource

Execute the Polh monad against the binary Polh representation located in the given directory. Return Nothing if the directory doesnt' exist or if it doesn't look like a Polh dictionary. We assume that the binary representation doesn't change so we can provide the pure interface.

index :: PolhM [Key]Source

List of dictionary keys.

withKey :: Key -> PolhM (Maybe LexEntry)Source

Extract lexical entry with the given ID.

lookup :: Text -> PolhM [LexEntry]Source

Lookup the form in the dictionary.