How to use the cltk.phonology.orthophonology.PhonologicalFeature function in cltk

To help you get started, we’ve selected a few cltk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cltk / cltk / cltk / phonology / orthophonology.py View on Github external
def matches(self, other):
        return make_phoneme(self).matches(other)

    def __eq__(self, other):
        return False if type(self) != type(other) else IntEnum.__eq__(self, other)

    def __floordiv__(self, other):
        return make_phoneme(self) // other


class Consonantal(PhonologicalFeature):
    neg = auto()
    pos = auto()


class Voiced(PhonologicalFeature):
    neg = auto()
    pos = auto()


class Aspirated(PhonologicalFeature):
    neg = auto()
    pos = auto()


class Geminate(PhonologicalFeature):
    neg = auto()
    pos = auto()


class Roundedness(PhonologicalFeature):
    neg = auto()
github cltk / cltk / cltk / phonology / orthophonology.py View on Github external
return make_phoneme(self) <= other

    def __ge__(self, other):
        return make_phoneme(self) >= other

    def matches(self, other):
        return make_phoneme(self).matches(other)

    def __eq__(self, other):
        return False if type(self) != type(other) else IntEnum.__eq__(self, other)

    def __floordiv__(self, other):
        return make_phoneme(self) // other


class Consonantal(PhonologicalFeature):
    neg = auto()
    pos = auto()


class Voiced(PhonologicalFeature):
    neg = auto()
    pos = auto()


class Aspirated(PhonologicalFeature):
    neg = auto()
    pos = auto()


class Geminate(PhonologicalFeature):
    neg = auto()
github cltk / cltk / cltk / phonology / orthophonology.py View on Github external
close = auto()
    near_close = auto()
    close_mid = auto()
    mid = auto()
    open_mid = auto()
    near_open = auto()
    open = auto()


class Backness(PhonologicalFeature):
    front = auto()
    central = auto()
    back = auto()


class Manner(PhonologicalFeature):
    stop = auto()
    fricative = auto()
    affricate = auto()
    nasal = auto()
    lateral = auto()
    trill = auto()
    spirant = auto()
    approximant = auto()


class Place(PhonologicalFeature):
    bilabial = auto()
    labio_dental = auto()
    dental = auto()
    alveolar = auto()
    post_alveolar = auto()
github cltk / cltk / cltk / phonology / orthophonology.py View on Github external
class Aspirated(PhonologicalFeature):
    neg = auto()
    pos = auto()


class Geminate(PhonologicalFeature):
    neg = auto()
    pos = auto()


class Roundedness(PhonologicalFeature):
    neg = auto()
    pos = auto()


class Length(PhonologicalFeature):
    short = auto()
    long = auto()
    overlong = auto()


# order for Height, Backness, and Manner is important
# the feature values must be ordered by *increasing sonority*
class Height(PhonologicalFeature):
    close = auto()
    near_close = auto()
    close_mid = auto()
    mid = auto()
    open_mid = auto()
    near_open = auto()
    open = auto()
github cltk / cltk / cltk / phonology / orthophonology.py View on Github external
class Consonantal(PhonologicalFeature):
    neg = auto()
    pos = auto()


class Voiced(PhonologicalFeature):
    neg = auto()
    pos = auto()


class Aspirated(PhonologicalFeature):
    neg = auto()
    pos = auto()


class Geminate(PhonologicalFeature):
    neg = auto()
    pos = auto()


class Roundedness(PhonologicalFeature):
    neg = auto()
    pos = auto()


class Length(PhonologicalFeature):
    short = auto()
    long = auto()
    overlong = auto()


# order for Height, Backness, and Manner is important
github cltk / cltk / cltk / phonology / orthophonology.py View on Github external
central = auto()
    back = auto()


class Manner(PhonologicalFeature):
    stop = auto()
    fricative = auto()
    affricate = auto()
    nasal = auto()
    lateral = auto()
    trill = auto()
    spirant = auto()
    approximant = auto()


class Place(PhonologicalFeature):
    bilabial = auto()
    labio_dental = auto()
    dental = auto()
    alveolar = auto()
    post_alveolar = auto()
    retroflex = auto()
    palatal = auto()
    velar = auto()
    uvular = auto()
    glottal = auto()


# ------------------- Phonemes -------------------

class AbstractPhoneme:
    """
github cltk / cltk / cltk / phonology / orthophonology.py View on Github external
overlong = auto()


# order for Height, Backness, and Manner is important
# the feature values must be ordered by *increasing sonority*
class Height(PhonologicalFeature):
    close = auto()
    near_close = auto()
    close_mid = auto()
    mid = auto()
    open_mid = auto()
    near_open = auto()
    open = auto()


class Backness(PhonologicalFeature):
    front = auto()
    central = auto()
    back = auto()


class Manner(PhonologicalFeature):
    stop = auto()
    fricative = auto()
    affricate = auto()
    nasal = auto()
    lateral = auto()
    trill = auto()
    spirant = auto()
    approximant = auto()
github cltk / cltk / cltk / phonology / orthophonology.py View on Github external
class Voiced(PhonologicalFeature):
    neg = auto()
    pos = auto()


class Aspirated(PhonologicalFeature):
    neg = auto()
    pos = auto()


class Geminate(PhonologicalFeature):
    neg = auto()
    pos = auto()


class Roundedness(PhonologicalFeature):
    neg = auto()
    pos = auto()


class Length(PhonologicalFeature):
    short = auto()
    long = auto()
    overlong = auto()


# order for Height, Backness, and Manner is important
# the feature values must be ordered by *increasing sonority*
class Height(PhonologicalFeature):
    close = auto()
    near_close = auto()
    close_mid = auto()
github cltk / cltk / cltk / phonology / orthophonology.py View on Github external
def __getitem__(self, feature_name):
        """
        Use dict-type syntax for accessing the values of features.
        """
        if not issubclass(feature_name, PhonologicalFeature):
            raise TypeError(str(feature_name) + ' is not a phonological feature')
        return self.features.get(feature_name, None)
github cltk / cltk / cltk / phonology / orthophonology.py View on Github external
def __init__(self, *phonemes):
        super().__init__(self)
        if any([not isinstance(p, AbstractPhoneme) and
                not isinstance(p, PhonologicalFeature) and
                not isinstance(p, list) for p in phonemes]):
            raise TypeError(phonemes)
        true_phonemes = [make_phoneme(p) if not isinstance(p, AbstractPhoneme) else p for p in phonemes]
        self.extend(true_phonemes)