def __init__(self, rate_generator=None, expression_generator=None, *args, **kwargs): """prefix: prefix all rate variables with this prefix.""" ChainComponent.__init__(self, *args, **kwargs) if not rate_generator: self.mRateGenerator = Rates() else: self.mRateGenerator = rate_generator if not expression_generator: self.mExpressionGenerator = Expressions() else: self.mExpressionGenerator = expression_generator
def buildGrammar(self, chain): """build grammar. This stub generically iterates over the alphabet and calls self.addTransitions for each pair of letters. """ ChainComponent.buildGrammar(self, chain) alphabet = self.mChainGenerator.getAlphabet() l = len(alphabet) for l1 in range(0, l - 1): a = alphabet[l1] for l2 in range(l1 + 1, l): self.addTransitions(chain, a, alphabet[l2])
def buildGrammar(self, chain): """build grammar for chain by adding initial states.""" ChainComponent.buildGrammar(self, chain)
def __init__(self, *args, **kwargs): ChainComponent.__init__(self, *args, **kwargs)
def buildGrammar(self, chain): """build grammar for chain by adding initial states.""" ChainComponent.buildGrammar(self,chain)
def __init__(self, *args, **kwargs): ChainComponent.__init__(self, *args, **kwargs )