cldf-clts / clts-legacy

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

List of features/descriptors #109

Closed tresoldi closed 6 years ago

tresoldi commented 6 years ago

Is there a recommended way to obtain a list of all the features/descriptors? Something like ['breathy', 'pre-glottalized', 'rhotacized', 'alveolar', ...].

The features property (such as in bipa.features) is not really enough with its frozen sets as dictionary keys; what I need is basically the VALUE column from the various features.tsv files, but of course it is better if we can have it grouped by TYPE (such as "vowel") and FEATURE (such as "centralization").

I could work on this later if preferred, just tell me where/how to offer the information.

LinguList commented 6 years ago

I think I pasted some code in the past to do exactly that.

LinguList commented 6 years ago

will dig it out.

LinguList commented 6 years ago

yes, found it, look in the cookbook, there's a file called "features". we could add a command that pulls out the features, but even easier is to just load the features.json

tresoldi commented 6 years ago

For the time being, I'll manage it with this.

def get_features():
    table = set()
    for s in BIPA.sounds:
        if not BIPA[s].type == 'marker':
            table.update(BIPA[s]._features())

    return sorted(list(table))

I'm closing the issue, we can always get back to this.