Code Monkey home page Code Monkey logo

phonologicaleditdistance's Introduction

Phonological Edit Distance

This uses the mighty power of Phonological Corpus Tools to calculate the average phonological edit distance of all items in a set. This can be used as a proxy measure of phonological dissimilarity.

Dependencies:

To run this you must have:

Note that you must have PCT version 1.1.0 to run this, and supply your own feature matrix. Later versions of PCT crash with this code. Feel free to message me if you encounter difficulties.


About:

The (Levenshtein) edit distance is the number of operations (i.e. add, delete, replace) needed to change one string to another. For example 'bat'->'pat' has an edit distance of 1. But some changes may more phonologically different than others. For example, 'bat'->'rat' differs in more phonological features than 'bat'->'pat'. The phonological edit distance takes the levenshtein edit distance and weights it based off the difference in phonological features. More info can be found here

How to use:

Right now there's no pretty input or output methods because I'm lazy, but if you feel like adding them in let me know. With that out of the way...
phonoEditDistanceWITHINsubjects.py compares a set of words to itself, and phonoEditDistanceBETWEENsubjects.py compares a set of words to another set of words.

Using phonoEditDistanceWITHINsubjects.py:

  • Replace "myCorpus.csv" with the corpus of your choice. (Note: make sure it's formatted properly)
  • Open a terminal window and type sudo python3 phonoEditDistanceWITHINsubjects.py. (Note: may not need sudo, or to specify python3 if it's the only version you have installed).

Using phonoEditDistanceWITHINsubjects.py:

  • Replace "corpusA.csv" and "corpusB.csv" with the corpora you wish to compare.
  • Open a terminal window and type sudo python3 phonoEditDistanceBETWEENsubjects.py. (Note: may not need sudo, or to specify python3 if it's the only version you have installed).

phonologicaleditdistance's People

Contributors

bschne avatar dvdmrn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.