def resolve_sound(self, string): if isinstance(string, Sound): # noqa: F405 return self.features[string.featureset] if set(string.split(' ')).intersection( list(self.sound_classes) + ['diphthong', 'cluster']): return self._from_name(string) string = nfd(string) return self._parse(string)
def normalize(self, string): """Normalize the string according to normalization list""" return ''.join([self._normalize.get(x, x) for x in nfd(string)])