dmort27 / epitran

A tool for transcribing orthographic text as IPA (International Phonetic Alphabet)
MIT License
625 stars 120 forks source link

Loading mapping files from other locations #141

Open le-doude opened 1 year ago

le-doude commented 1 year ago

Goal

I am using epitran in a quick project but I'd like to keep my install clean. Is it possible to point Epitran to an external folder where I define my own custom mappings? For full disclosure I am trying to create a jpn-Jpan mapping.

Even something simple like this:

import epitran
epi = epitran.Epitran('/my/mappinps/data/map/jpn-Jpan.csv', '/my/mappinps/data/pre/jpn-Jpan.txt', '/my/mappinps/data/post/jpn-Jpan.txt')
dmort27 commented 1 year ago

Unfortunately, there is not currently a way to do this (because Epitran has focused on being self-contained). Of course, it would be possible to add this, but I'm not able to do this right now). I suppose I would add a --path keyword argument that would add that hierarchy to the search path, If I were doing this. If you would like to submit a PR, we will accept it.