Esempio n. 1
0
class TwitterSom(OneToOneNode):
    def __init__(self, router, nodeDict):
        OneToOneNode.__init__(self, router, nodeDict)
        from backend.som import SOMBuilder
        self.som = SOMBuilder(k=20, map_size=tuple(self.node['_somsize']))
        self.som.send = make_send(self, incr=False)
    
    def compute(self, data):
        self.som.on_message(data)
Esempio n. 2
0
 def handle_vector(self, vec, text):
     for eq, end, x, y in self.fixed:
         if text == eq or text.endswith(end):
             self.handle_fixed_vector(vec, text, x, y)
     SOMBuilder.handle_vector(self,
                              vec,
                              text,
                              rratio=2,
                              rstep=0.5,
                              sratio=0.5,
                              nbefore=True)
Esempio n. 3
0
 def handle_vector(self, vec, text):
     for eq, end, x, y in self.fixed:
         if text == eq or text.endswith(end):
             self.handle_fixed_vector(vec, text, x, y)
     SOMBuilder.handle_vector(self, vec, text, rratio=2, rstep=0.5, sratio=0.5, nbefore=True)
Esempio n. 4
0
 def __init__(self, fixed, *args, **kwargs):
     SOMBuilder.__init__(self, *args, **kwargs)
     self.fixed = fixed
Esempio n. 5
0
 def __init__(self, router, nodeDict):
     OneToOneNode.__init__(self, router, nodeDict)
     from backend.som import SOMBuilder
     self.som = SOMBuilder(k=20, map_size=tuple(self.node['_somsize']))
     self.som.send = make_send(self, incr=False)
Esempio n. 6
0
 def __init__(self, fixed, *args, **kwargs):
     SOMBuilder.__init__(self, *args, **kwargs)
     self.fixed = fixed