cldf-clts / clts-legacy

Cross-Linguistic Transcription Systems
Apache License 2.0
4 stars 3 forks source link

Classes of a SoundClass #114

Closed Anaphory closed 6 years ago

Anaphory commented 6 years ago

Is there a better way of getting the classes inventory of a sound class system than by

sca = pyclts.SoundClasses('sca')
set(value['grapheme'] for value in sca.data.values())

and if not, should there be?

LinguList commented 6 years ago

what do you mean by inventory?

Anaphory commented 6 years ago

The result of the second line, so eg.

{'2', '1', '5', 'I', 'E', 'C', '6', 'L', 'A', 'T', 'G', 'O', '9', '4', 'Y', 'W', 'P', 'K', 'B', '_', 'D', 'S', 'J', 'N', '0', 'U', '!', 'H', '3', 'R', 'M'}
LinguList commented 6 years ago

Ah, no, not that I knew of. But LingPy has:

>>> m = Model('sca')
>>> m.chars2int
LinguList commented 6 years ago

But only as long as sound classes are derived from lingpy, and I assume, they won't in the future, as we can imagine systems that are just based on the sounds in clts...

LinguList commented 6 years ago

BTW: adding this to the library is a good idea. In fact: whe reading the file IN to the system, it could just be collected. If you want to go ahead with this, please do so.