Skip to content
This repository has been archived by the owner on Oct 22, 2019. It is now read-only.

Make sounds hashable #107

Closed
Anaphory opened this issue Feb 21, 2018 · 6 comments
Closed

Make sounds hashable #107

Anaphory opened this issue Feb 21, 2018 · 6 comments

Comments

@Anaphory
Copy link
Contributor

It would be very nice if Sound objects were hashable. I'm not entirely sure what should be hashed, but creating sets of Sounds (eg. for phoneme inventories) and having dicts with sound sequence (tuple of Sound) keys looks useful to me already just from building some toy functionality on the basis of pyclts.

There is probably a better implementation than

    def __hash__(self):
        return hash(self.name)

but I haven't delved into the intestines of the objects or what TranscriptionSystems and other classes might need here so say what that might be.

@tresoldi
Copy link
Contributor

tresoldi commented Feb 21, 2018 via email

@xrotwang
Copy link
Collaborator

xrotwang commented Feb 21, 2018 via email

@LinguList
Copy link
Collaborator

the feature vector is a frozenset, this is hashable already, ain't it?

@LinguList
Copy link
Collaborator

if you frozenset your features, you can access them via bipa.features. Or do you mean something differently?

@tresoldi
Copy link
Contributor

tresoldi commented Feb 21, 2018 via email

@LinguList
Copy link
Collaborator

is this still considered to be important for anybody? If not I'll just close for the time being...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants