Closed tresoldi closed 6 years ago
I think I pasted some code in the past to do exactly that.
will dig it out.
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
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.
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 inbipa.features
) is not really enough with its frozen sets as dictionary keys; what I need is basically theVALUE
column from the variousfeatures.tsv
files, but of course it is better if we can have it grouped byTYPE
(such as "vowel") andFEATURE
(such as "centralization").I could work on this later if preferred, just tell me where/how to offer the information.