Skip to main content

Library for dealing with sound changes

Project description

alteruphono

Build Status codecov

alteruphono is a Python library for applying sound changes to phonetic and phonological representations, intended for use in simulations of language evolution.

Please remember that alteruphono is a work-in-progress.

Installation

In any standard Python environment, alteruphono can be installed with:

pip install alteruphono

The pip installation with also fetch dependencies, such as pyclts, if necessary. Installation in virtual environments is recommended.

How to use

Sound sequences are to be given in common CLDF/LingPy notation, i.e., as a single string with single space-separated graphemes. The library supports different transcription systems, defaulting BIPA as defined in pyclts.

Sound changes are defined by simplified regular expressions. Check the resources/sounds_changes.tsv for an example.

A basic usage, drawing a random sound change from the default collection and applying it, is:

import alteruphono

rules = alteruphono.utils.read_sound_changes()
random_rules = [alteruphono.utils.random_change(rules) for r in range(3)]
for rule in random_rules:
    source = rule["source"]
    target = rule["target"]
    test_case = rule["test"].split("/")[0].strip()

    print("%s -> %s" % (source, target))
    print("  [%s] [%s]" % (test_case, alteruphono.apply_rule(test_case, source, target)))

returning:

V N C -> @1[+nasalized] @3
  [a b ts a r i m b s u] [a b ts a r ĩ b s u]
e i -> a i
  [d i a z e i l e n] [d i a z a i l e n]
n k|g -> ŋ @2
  [a k a n k m i k s] [a k a ŋ k m i k s]

TODO

  • Use logging everywhere
  • Implement automatic, semi-automatic, and requested syllabification based on prosody strength
  • Implement both PEG grammars from separate repository
  • Add support for custom replacement functions (deciding on notation)

How to cite

If you use alteruphono, please cite it as:

Tresoldi, Tiago (2019). Alteruphono, a tool for simulating sound changes. Version 0.0.1dev. Jena. Available at: https://github.com/tresoldi/alteruphono

In BibTex:

@misc{Tresoldi2019alteruphono,
  author = {Tresoldi, Tiago},
  title = {Alteruphono, a tool for simulating sound changes},
  howpublished = {\url{https://github.com/tresoldi/alteruphono}},
  address = {Jena},
  year = {2019},
}

Author

Tiago Tresoldi (tresoldi@shh.mpg.de)

The author was supported during development by the ERC Grant #715618 for the project CALC (Computer-Assisted Language Comparison: Reconciling Computational and Classical Approaches in Historical Linguistics), led by Johann-Mattis List.

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

alteruphono-0.0.1.dev0.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alteruphono-0.0.1.dev0-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file alteruphono-0.0.1.dev0.tar.gz.

File metadata

  • Download URL: alteruphono-0.0.1.dev0.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.9.1 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.4

File hashes

Hashes for alteruphono-0.0.1.dev0.tar.gz
Algorithm Hash digest
SHA256 a003fa9bf18f5e7fc3891148d716e5cc741d033ac1168d46d33c3d6da389acf4
MD5 015a05d371bc44fe587170ba81192ebc
BLAKE2b-256 99c50750db614a9924ecd132f7ae070aef76bc768eb5b8ced77c7d4026c0375b

See more details on using hashes here.

File details

Details for the file alteruphono-0.0.1.dev0-py3-none-any.whl.

File metadata

  • Download URL: alteruphono-0.0.1.dev0-py3-none-any.whl
  • Upload date:
  • Size: 22.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.9.1 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.4

File hashes

Hashes for alteruphono-0.0.1.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a294fe42781f3f31b5c7a0ee2e0a2b14ffee498fd6f7c53db1521b8395cfedb
MD5 22180eafd927c9946231c9c94ca7f3e2
BLAKE2b-256 41a49b5a3e8fb4369f720b0ab9035df36fa53740344ac7b91d837586370b6d7a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page