Exemplo n.º 1
0
 def __init__(self, factors):
     self.factors = Normalizer.of(factors).normalize()
Exemplo n.º 2
0
 def testNormalisationOfFactors(self):
     self.assertEquals([('a', 1)], Normalizer.of([('a', 1)]).normalize())
     self.assertEquals([('b', -1)], Normalizer.of([('b', -1)]).normalize())
     self.assertEquals([], Normalizer.of([('a', 1), ('a', -1)]).normalize())
     self.assertEquals([], Normalizer.of([('b', -1), ('a', 1), ('a', -1), ('b', 1)]).normalize())