diff options
Diffstat (limited to 'grammar.py')
| -rw-r--r-- | grammar.py | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -2,16 +2,12 @@ from cadence import * from numpy import array from numpy.random import choice, seed - - class Grammar(object): def __init__(self, phonology=None, morphology=None, syntax=None): - self.phonology - self.morphology - self.syntax - - + self.phonology = phonology + self.morphology = morphology + self.syntax = syntax class Phonology(object): @@ -124,6 +120,12 @@ class Morphology(object): def addProlongationRule(self, projectedFeatures): self.prolongationRules.append(projectedFeatures) + def selectAnticipation(self): + return choice(self.anticipationRules) + + def selectProlongation(self): + return choice(self.prolongationRules) + def print(self): features = { 'anticipations': self.anticipationRules, |