Skip to content

Instantly share code, notes, and snippets.

@fauxneticien
Created June 22, 2022 12:21
Show Gist options
  • Save fauxneticien/3908006ea6d3f4e9531b60cecaba4ea4 to your computer and use it in GitHub Desktop.
Save fauxneticien/3908006ea6d3f4e9531b60cecaba4ea4 to your computer and use it in GitHub Desktop.
Python via phonology
# Abstract class ('phoneme')
class Consonant:
# Class attributes assigned when initialised ('realised')
def __init__(self, place_of_art, manner_of_art):
self.place_of_art = place_of_art
self.manner_of_art = manner_of_art
def lenite(self):
if self.manner_of_art == 'stop':
self.manner_of_art = 'fricative'
if self.manner_of_art == 'fricative':
self.manner_of_art = 'approximant'
# Initialise/create object ('phone') from abstract class
b = Consonant("labial", "stop")
print(b.manner_of_art)
b.lenite()
print(b.manner_of_art)
b.lenite()
print(b.manner_of_art)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment