def __calc_confidence(self, match, phrase, level):
    consumed_pct = (len(match.split()) / len(phrase.split()))
    if (consumed_pct > 1.0):
        consumed_pct = 1.0
    platform = self.config_core.get('enclosure', {}).get('platform')
    if (is_CQSVisualMatchLevel(level) and handles_visuals(platform)):
        bonus = 0.1
    else:
        bonus = 0
    if (int(level) == int(CQSMatchLevel.EXACT)):
        return ((0.9 + (consumed_pct / 10)) + bonus)
    elif (int(level) == int(CQSMatchLevel.CATEGORY)):
        return ((0.6 + (consumed_pct / 10)) + bonus)
    elif (int(level) == int(CQSMatchLevel.GENERAL)):
        return ((0.5 + (consumed_pct / 10)) + bonus)
    else:
        return 0.0
def __calc_confidence(self, match, phrase, level):
    consumed_pct = (len(match.split()) / len(phrase.split()))
    if (consumed_pct > 1.0):
        consumed_pct = 1.0
    platform = self.config_core.get('enclosure', {}).get('platform')
    if (is_CQSVisualMatchLevel(level) and handles_visuals(platform)):
        bonus = 0.1
    else:
        bonus = 0
    if (int(level) == int(CQSMatchLevel.EXACT)):
        return ((0.9 + (consumed_pct / 10)) + bonus)
    elif (int(level) == int(CQSMatchLevel.CATEGORY)):
        return ((0.6 + (consumed_pct / 10)) + bonus)
    elif (int(level) == int(CQSMatchLevel.GENERAL)):
        return ((0.5 + (consumed_pct / 10)) + bonus)
    else:
        return 0.0