summaryrefslogtreecommitdiff
path: root/grammar.py
diff options
context:
space:
mode:
Diffstat (limited to 'grammar.py')
-rw-r--r--grammar.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/grammar.py b/grammar.py
index 2f8e385..44e110b 100644
--- a/grammar.py
+++ b/grammar.py
@@ -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,