brassica-0.3.0: Featureful sound change applier
Safe HaskellSafe-Inferred
LanguageHaskell2010

Brassica.SFM.MDF

Description

This module contains types and functions for working with the MDF dictionary format, used by programs such as SIL Toolbox. For more on the MDF format, refer to e.g. Coward & Grimes (2000), Making Dictionaries: A guide to lexicography and the Multi-Dictionary Formatter.

Synopsis

Documentation

data MDFLanguage Source #

The designated language of an MDF field.

Instances

Instances details
Show MDFLanguage Source # 
Instance details

Defined in Brassica.SFM.MDF

Eq MDFLanguage Source # 
Instance details

Defined in Brassica.SFM.MDF

fieldLangs :: Map String MDFLanguage Source #

A Map from the most common field markers to the language of their values.

(Note: This is currently hardcoded in the source code, based on the values in the MDF definitions from SIL Toolbox. The exception is et, which is assigned as Other rather than Vernacular. There’s probably a more principled way of defining this, but hardcoding should suffice for now.)

mdfHierarchy :: Hierarchy Source #

Standard MDF hierarchy: with lx > se > ps > sn. Intended for use with toTree.

mdfAlternateHierarchy :: Hierarchy Source #

Alternate MDF hierarchy: with lx > sn > se > ps. Intended for use with toTree.

tokeniseMDF Source #

Arguments

:: [String]

List of available multigraphs (as with tokeniseWord)

-> SFM 
-> Either (ParseErrorBundle String Void) [Component PWord] 

Convert an SFM document to a list of Components representing the same textual content. Vernacular field values are tokenised as if using tokeniseWords; everything else is treated as a Separator, so that it is not disturbed by operations such as rule application or rendering to text.

duplicateEtymologies Source #

Arguments

:: (String -> String)

Transformation to apply to etymologies, e.g. (*:)

-> SFMTree 
-> SFMTree 

Add etymological fields to an MDF by duplicating the values in lx, se and ge fields. e.g.:

\lx kapa
\ps n
\ge parent
\se sakapa
\ge father

Would become:

\lx kapa
\ps n
\ge parent
\et kapa
\eg parent
\se sakapa
\ge father
\et sakapa
\eg father

This can be helpful when applying sound changes to an MDF file: the vernacular words can be copied as etymologies, and then the sound changes can be applied leaving the etymologies as is.