From dbd040425b7c066b0803e0f329dd887b11156635 Mon Sep 17 00:00:00 2001 From: Houyhnhnm Date: Sat, 2 Jun 2018 22:10:48 +0200 Subject: prettier print methods --- phonology.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'phonology.py') 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() -- cgit v1.2.3