Skip to main content

cldflex

Convert FLEx data to CLDF-ready CSV.

Versions PyPI License

Many descriptive linguists have annotated language data in a FLEx (SIL's Fieldworks Lexical Explorer) database, which provides perhaps the most popular and accessible assisted segmentation and annotation workflow. However, a reasonably complete data export is only available in XML, which is not human-friendly, and is not readily converted to other data. A data format growing in popularity is the CLDF standard, a table-based approach with human-readable datasets, designed to be used in CLLD apps and easily processable by any software that can read CSV files, including R, pandas or spreadsheet applications. The goal of cldflex is to convert lexicon and corpus data stored in FLEx to CSV tables, primarily for use in CLDF datasets.

Installation

cldflex is available on PyPI:

pip install cldflex

Command line usage

At the moment, there are three commands: cldflex corpus for .flextext files; cldflex dictionary and cldflex wordlist for .lift files. All commands create a number of CSV files. One can either use cldfbench to create one's own CLDF datasets from these files, or add the --cldf argument to create a simple CLDF dataset. Project-specific configuration can be passed by --conf your/config.yaml, or creating a file cldflex.yaml

corpus

Basic usage:

cldflex corpus texts.flextext

Connect the corpus with the lexicon:

cldflex corpus texts.flextext --lexicon lexicon.lift

Create a CLDF dataset:

cldflex corpus texts.flextext --lexicon lexicon.lift --cldf

dictionary

Extract morphemes, morphs, and entries from lexicon.lift:

cldflex dictionary lexicon.lift

Create a CLDF dataset with a Dictionary module:

cldflex dictionary lexicon.lift --cldf

wordlist

Create a CLDF dataset with a Wordlist module:

cldflex wordlist lexicon.lift --cldf

API usage

The functions corresponding to the commands above are cldflex.corpus.convert() and cldflex.lift2csv.convert().

Configuration

There is no default configuration. Rather, cldflex will guess values for most of the parameters below and tell you what it's doing. It is suggested to start out configuration-free until something goes wrong or you want to change something. Create a YAML file for CLI usage, pass a dict to the convert methods.

  • obj_lg: the object language
  • gloss_lg: the language used for glossing / translation
  • msa_lg: the language used for storing POS information
  • lang_id: the value to be used in the created tables
  • glottocode: used to look up language metadata from glottolog
  • csv_cell_separator: if there are multiple values in a cell (allomorphs, polysemy...), they are by default separated by "; "
  • form_slices: set to false if you don't want form slices connecting morphs and word forms
  • mappings: a dictionary specifying name changes of columns in the created CSV files

Release files for cldflex 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cldflex 0.1.1
File Size Uploaded
cldflex-0.1.1.tar.gz 21.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cldflex 0.1.1
File Interpreter ABI Platform
cldflex-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 44.4 kB

Release files / cldflex-0.1.1.tar.gz

Download URL cldflex-0.1.1.tar.gz
Size 21.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6381ebf7b0b2647d0d0c6ddd8bf48acdba5c2dbfc00e3effc407e02a319a3606
BLAKE2b-256 checksum
How to use checksums
fb71ff444f58d4d9491396817ae180ad68cb3ee9bc95984859fa110bd7be1402
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.0 CPython/3.8.10 Linux/5.15.0-73-generic

Release files / cldflex-0.1.1-py3-none-any.whl

Download URL cldflex-0.1.1-py3-none-any.whl
Size 22.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
87cbcb2eb15ae1cf41becb8793af1f70d057dd6b5ea67dbfca0110ffd8add4ec
BLAKE2b-256 checksum
How to use checksums
4489e9bd891849896a60286a473a4e941ffee7ccde195b4c57af1768ee677276
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.0 CPython/3.8.10 Linux/5.15.0-73-generic

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page