summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorHouyhnhnm <hykusb@bitmai.la>2018-06-03 18:47:29 +0200
committerHouyhnhnm <hykusb@bitmai.la>2018-06-03 18:47:29 +0200
commit01071c8123e6b30eeff88272bf4fc7325d62dd5a (patch)
tree9598b4cc53546df62804e672e3c14215edf8ee94 /main.py
parent3786e330479d00517ecb894804180f59b0544e1a (diff)
added syntax tree generation, feature unification
Diffstat (limited to 'main.py')
-rw-r--r--main.py30
1 files changed, 20 insertions, 10 deletions
diff --git a/main.py b/main.py
index 976e214..7cf66a2 100644
--- a/main.py
+++ b/main.py
@@ -1,5 +1,6 @@
-from diagram import *
from grammar import *
+from lexicon import *
+from passage import *
from spec import *
'''
@@ -10,24 +11,33 @@ projection.py dependencies and agreement
antecedent or consequent cadence bundled with prolongation rules for each feature - (dominates) or (dominates, agrees) or (dominates, agrees, submits)
(1)==Head; (0)==Complement; (1,0)==XP; (1,1)==XBar; (0,1)==X; (0,0)==None;
-diagram.py define binary tree structures
phonology.py distribution of cadential features for given grammar
lexicon.py repository of lexemes: (cadence, dependencies, prolongation)
-passage.py lexemes unified over tree diagram
+passage.py lexemes unified over binary tree
spellout() sequence of unified cadences in passage (for each voice)
score.py list of n passages rendered to music21 score object
- export() to xml, midi, ly
+ export() to xml, midi, ly'
'''
# lexicon.addCategory()
-phonology.print()
-morphology.print()
+g.phonology.print()
+g.morphology.print()
+
+lexicon = Lexicon()
+lexicon.populate(g, 4)
+lexicon.print()
+
+passage = Passage(size=12)
+passage.printSyntax()
+
+realization = passage.spellout(lexicon)
+
+pprint(realization)
+
+for lex in realization:
+ lex.print()
-lexeme = phonology.makeCadence()
-lexeme.print()
-syntax = Diagram()
-syntax.print()