Closed tresoldi closed 4 years ago
Pinging @LinguList and @xrotwang
So to clarify, you have a sound in Phoible's original grapheme list, and want the corresponding BIPA sound, right?
Yes, it is for the inventory study. I can get the CLTS sound with phoible.resolve_grapheme(grapheme)
(with phoible
the clts.transcriptiondata("phoible")
, but I did not find documentation for it.
Using phoible[grapheme]
would make it more similar to transcription systems, and there is also the issue that it currently raises an exception if the grapheme is not listed (in this case, due to using the development version of Phoible, while the mapping in CLTS data follows the last released version).
If you check lexibank/allenbai as well as the code that I wrote for the inventory comparison in lexicore (will be moved to lexibanklater, now lexibank/pylexicore) you will see that we have another way to proceed here:
Every td
has its grapheme_map
attribute that allows to access the BIPA sound for a corresponding original grapheme.
The essential code is here:
Ok, I will do it this way.
The usage of
TranscriptionData
to map a grapheme in a dataset to a CLTS sound (i.e.,.resolve_grapheme()
) does not seem to be documented, and raises an exception (ValueError) if we pass a a grapheme not in the list.As it is arguably one of the main intended usages of the class, I would suggest we:
.__get__()
method that wraps.resolve_grapheme()
, so we can do calls likephoible["bɾ"]
.resolve_grapheme()
to return anUnknownSound
instead of raising an exception (but note that this is not totally symmetric with.resolve_sound()
.I can prepare a PR for that, it accepted.