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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

Supported by

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