diff options
| author | Houyhnhnm <hykusb@bitmai.la> | 2018-06-03 14:06:16 +0200 |
|---|---|---|
| committer | Houyhnhnm <hykusb@bitmai.la> | 2018-06-03 14:06:16 +0200 |
| commit | 3786e330479d00517ecb894804180f59b0544e1a (patch) | |
| tree | ef503829490755f4da0ecd3ecb7e47441e37590e /spec.py | |
| parent | 2fe6d52452b2cf48ceeffcbc0e8c2b30932f889d (diff) | |
bundle lexical ingredients in grammar object, separate spec file therefrom
Diffstat (limited to 'spec.py')
| -rw-r--r-- | spec.py | 58 |
1 files changed, 58 insertions, 0 deletions
@@ -0,0 +1,58 @@ +from grammar import * + +footprintRules = [ + [{ + 'span': [2], + 'gait': ['double','triple'], + 'foot': [[-1/2, 0, 1/2]], + 'step': [[0, 1/2], [0, 1/2], [0, 1/2]], + }], +] + +functionRules = [ + { + 'address': ['A1','B1'], + 'transposition': [-1,0,1], + }, +] + +pathRules = [ + { + 'range': [2,3,4], + 'figure': ['rampUp', 'rampDown'], + 'tilt': ['float', 'dive'], + }, +] + +anticipationRules = [ + ['footprint'], + ['tilt'], + [], +] + +prolongationRules = [ + ['address','transposition'], + ['address'], + ['figure','range'], + ['range'], + ['range','tilt'], +] + +# assemble grammar object +phonology = Phonology() +for rule in footprintRules: + phonology.addFootprintRule(rule) +for rule in functionRules: + phonology.addFunctionRule(rule) +for rule in pathRules: + phonology.addPathRule(rule) + +morphology = Morphology() +for rule in anticipationRules: + morphology.addAnticipationRule(rule) +for rule in prolongationRules: + morphology.addProlongationRule(rule) + +g = Grammar() +g.phonology = phonology +g.morphology = morphology |