A python package to help avoid pitfalls when using unicode for linguistic data.
Project description
Multicode: Miscelleneous functions for handling unicode in transcriptions
General information
This repository provides code and data to normalize datasets, to avoid pitfalls of unicode when creating linguistic data, and to infer general information about digital data when dealing with it in linguistic contexts.
One major concern is the normalization of phonetic transcriptions. There are many lookalikes in unicode which linguists use without knowing that they are not what they initially want to write. Thus the character used to transcribe an alveolar voiceless fricative, for example, has three candidates in Unicode which look extremely similar: ʃ ∫ ꭍ
, although only the first one is the character that should be used when writing phonetic transcriptions. Our goal is to provide ways to detect and normalize those cases which result from the confusion of Unicode characters when transcribing languages phonetically.
Other cases include specific writing systems, like CJK systems, where we want to offer services to more quickly handle them. These cases include the possibility to detect the Unicode code points of very rare characters by naming only the parts, but also simple Python functions that allow to determine whether a given character is a Chinese character or not.
CLI
Installing this package will also install the multicode
command.
Normalizing data
The main purpose of this package is data normalization, i.e. replacing lookalikes
in strings with the canonical characters. This can be done using the recode
subcommand, either passing a string as argument:
$ multicode recode "ʃ ∫ ꭍ"
ʃ ʃ ʃ
or using pipes, i.e. having recode
read from stdin:
$ echo "ʃ ∫ ꭍ" | multicode recode
ʃ ʃ ʃ
Structure of the Repository
Our repository contains data and code. Data is represented in a custom CSV dialect, namely tab-separated, with |
as optional secondary separator for field content. Unicode characters can be represented either as UTF-8 encoded strings, or using notation like U+0020
.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file multicode-0.2.1.tar.gz
.
File metadata
- Download URL: multicode-0.2.1.tar.gz
- Upload date:
- Size: 148.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.26.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1154b803d54668a6d5b3ddd6cd3d87e7bc7f87f116ac9765d6dd8f26be7fddfb |
|
MD5 | 13149e6ea2b87648e22a537c62ff8d5b |
|
BLAKE2b-256 | 76dd8240a32c108e2f6ee2083e3826679e0cee23e6446ab3eba014f89cae2a4d |
File details
Details for the file multicode-0.2.1-py2.py3-none-any.whl
.
File metadata
- Download URL: multicode-0.2.1-py2.py3-none-any.whl
- Upload date:
- Size: 149.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.26.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82698bdfa14b8b50bf9fd4a0ff85bccac28e8132952eab1f40db990e57021f0a |
|
MD5 | f1858314f2c1558bce2519ceb9c5f102 |
|
BLAKE2b-256 | ab86d1fa671d84f0fb3464893935419cf8e0672be8cf57551ad0a8189fb3b6d0 |