summaryrefslogtreecommitdiff
path: root/phonology.py
diff options
context:
space:
mode:
authorHouyhnhnm <hykusb@bitmai.la>2018-06-02 22:10:48 +0200
committerHouyhnhnm <hykusb@bitmai.la>2018-06-02 22:10:48 +0200
commitdbd040425b7c066b0803e0f329dd887b11156635 (patch)
tree9af2c8ec5522fcec8a6956b04c8cd101ea44e6c1 /phonology.py
parent8f2251a175d8d52edd12d62168c7c0e795be6146 (diff)
prettier print methods
Diffstat (limited to 'phonology.py')
-rw-r--r--phonology.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/phonology.py b/phonology.py
index 2e8d978..1853523 100644
--- a/phonology.py
+++ b/phonology.py
@@ -10,6 +10,16 @@ class Phonology(object):
self.functions = functions
self.paths = paths
+ def print(self):
+ features = {
+ 'footprints': self.footprints,
+ 'functions': self.functions,
+ 'paths': self.paths,
+ }
+ print("\nPhonology")
+ pprint(features)
+ print()
+
def addFootprintRule(self, footprintRule, weight=1):
self.footprints.append((footprintRule, weight))
@@ -19,9 +29,9 @@ class Phonology(object):
def addPathRule(self, pathRule, weight=1):
self.paths.append((pathRule, weight))
- def makeCadence(self): # (duration=None, harmonicFilter=None)
+ def makeCadence(self, label=''): # (duration=None, harmonicFilter=None)
""" assemble bundle of features from phonology rules """
- cadence = Cadence()
+ cadence = Cadence(label=label)
cadence.footprint = self.makeFootprint()
cadence.function = self.makeFunction()
cadence.path = self.makePath()