Created
June 22, 2022 12:21
-
-
Save fauxneticien/3908006ea6d3f4e9531b60cecaba4ea4 to your computer and use it in GitHub Desktop.
Python via phonology
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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