def get_feedback(score, sequence):
 global default_feedback
 if (len(sequence) == 0):
  return default_feedback
 if (score > 2):
  return dict({u'warning': u'', u'suggestions': []})
 longest_match = max(sequence, key=(lambda x: len(x[u'token'])))
 feedback = get_match_feedback(longest_match, (len(sequence) == 1))
 if (not feedback):
  feedback = {u'warning': u'', u'suggestions': [_(u'Better add a few more letters or another word')]}
 return feedback

def get_feedback ( score , sequence ) : global default_feedback if ( len ( sequence ) == 0 ) : return default_feedback if ( score > 2 ) : return dict ( { u'warning' : u'' , u'suggestions' : [ ] } ) longest_match = max ( sequence , key = ( lambda x : len ( x [ u'token' ] ) ) ) feedback = get_match_feedback ( longest_match , ( len ( sequence ) == 1 ) ) if ( not feedback ) : feedback = { u'warning' : u'' , u'suggestions' : [ _ ( u'Better add a few more letters or another word' ) ] } return feedback
returns the feedback dictionary consisting of for the given sequences .