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 /lexicon.py | |
| parent | 2fe6d52452b2cf48ceeffcbc0e8c2b30932f889d (diff) | |
bundle lexical ingredients in grammar object, separate spec file therefrom
Diffstat (limited to 'lexicon.py')
| -rw-r--r-- | lexicon.py | 32 |
1 files changed, 25 insertions, 7 deletions
@@ -1,23 +1,41 @@ -from phonology import * +from grammar import * from numpy.random import choice, seed class Lexicon(object): - def makeLexeme(self): + + def __init__(self, genesis_size=0): + self.categories = [] + + def generate(self, grammar, number_categories=0): + for x in range(number): + cadence = + anticipation = + prolongation = + lexeme = Lexeme(cadence, anticipation, prolongation) + self + + def addLexeme(): + + def makeCategory(): + + + def makeLexeme(cadence, anticipation=None, prolongation=None): + + def makeProjection(self): + pass class Lexeme(object): """the specification of an dependant and its agreement""" - def __init__(self, cadence=None, antecedent=None, consequent=None): + def __init__(self, cadence=None, anticipation=None, prolongation=None): if cadence=None: self.cadence = cadence # lexemes self.antecedents = [] self.consequents = [] # projections - self.anticipations = [] - self.prolongations = [] - - # self.label -- manage serial numbers somehow + self.anticipation = anticipation + self.prolongation = prolongation def addAntecedent(self, category): self.antecedents.append(category) |