def scalar_inc_dec(word, valence, is_cap_diff):
 scalar = 0.0
 word_lower = word.lower()
 if (word_lower in BOOSTER_DICT):
  scalar = BOOSTER_DICT[word_lower]
  if (valence < 0):
   scalar *= (-1)
  if (word.isupper() and is_cap_diff):
   if (valence > 0):
    scalar += C_INCR
   else:
    scalar -= C_INCR
 return scalar

def scalar_inc_dec ( word , valence , is_cap_diff ) : scalar = 0.0 word_lower = word . lower ( ) if ( word_lower in BOOSTER_DICT ) : scalar = BOOSTER_DICT [ word_lower ] if ( valence < 0 ) : scalar *= ( - 1 ) if ( word . isupper ( ) and is_cap_diff ) : if ( valence > 0 ) : scalar += C_INCR else : scalar -= C_INCR return scalar
check if the preceding words increase .