Exemplo n.º 1
0
 def neutrality_color(self):
     num = clamp(self.cumulative_neutrality, 70, 100)
     return color(num, [70,100], color1='808080', color2='0000FF')
Exemplo n.º 2
0
 def color(self):
     num = clamp(self.cumulative_sentiment, -25, 25)
     return color(num, [-25,25])
Exemplo n.º 3
0
 def neutrality_color(self):
     """Same as color but for neutrality, between grey and blue"""
     num = clamp(self.neutrality, 70, 100)
     return color(num, [70,100], color1='808080', color2='0000FF')
Exemplo n.º 4
0
 def compound_color(self):
     """Same as color and neutrality_color but for compound."""
     return color(self.compound, [-100,100])
Exemplo n.º 5
0
 def color(self):
     """A property for generating a color between red and green for the
     sentiment of the article.
     """
     num = clamp(self.sentiment, -25, 25)
     return color(num, [-25,25])