Coder Social home page Coder Social logo

tipafy's Introduction

These python files are wrappers on the ELTK python2 library:

https://github.com/sofarrar/e-linguistics/tree/master/eltk

http://uakari.ling.washington.edu/e-linguistics/eltk.html

They are intended to convert between LaTeX files with IPA unicode characters (for xelatex compilation) and LaTeX files with TIPA codes (for pdflatex compilation).

Install

  • Ensure you have a distribution of python2
  • Install eltk
  • Put files somewhere in your $PATH
  • Make them executable

Usage

tipafy and detipafy are small wrappers on ELTK's character conversion functions. They can be used as command line tools, either with an argument or reading stdin:

$ tipafy bɔ̃ʒuʁ
\textipa{b\~O ZuK}
$ detipafy "\textipa{b\~O ZuK}"
bɔ̃ʒuʁ
$ tipafy bɔ̃ʒuʁ | detipafy
bɔ̃ʒuʁ

tipafy_file takes a LaTeX file and applies the transformation and normalizes all tokens (except in comments):

  • longer than two characters and bounded by two "/" as in: "/bɔ̃ʒuʁ/" (but not "/bɔ̃/"). Be careful, this might mess with with URLS !
  • or containing characters from the following unicode blocks:
   0080..00FF; Latin-1 Supplement <- from 128
   0100..017F; Latin Extended-A
   0180..024F; Latin Extended-B
   0250..02AF; IPA Extensions
   02B0..02FF; Spacing Modifier Letters
   0300..036F; Combining Diacritical Marks    <- to 879
   2C60..2C7F; Latin Extended-C  <- (11360, 11391)
   A720..A7FF; Latin Extended-D  <- (42784, 43007)

If not present, it adds "\usepackage{tipa}" at the end of the document head.

detipafy_file does the opposite transformation for any token inside “\textipa{(.+?)}”, and adds comments with the original textipa code.

tipafy's People

Stargazers

 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.