'Stop analyzing the current document and come up with a final
prediction.
:returns:  The ``result`` attribute, a ``dict`` with the keys
`encoding`, `confidence`, and `language`.'

def close(self):

    if self.done:
        return self.result
    self.done = True
    if (not self._got_data):
        self.logger.debug('no    data    received!')
    elif (self._input_state == InputState.PURE_ASCII):
        self.result = {'encoding': 'ascii', 'confidence': 1.0, 'language': ''}
    elif (self._input_state == InputState.HIGH_BYTE):
        prober_confidence = None
        max_prober_confidence = 0.0
        max_prober = None
        for prober in self._charset_probers:
            if (not prober):
                continue
            prober_confidence = prober.get_confidence()
            if (prober_confidence > max_prober_confidence):
                max_prober_confidence = prober_confidence
                max_prober = prober
        if (max_prober and (max_prober_confidence > self.MINIMUM_THRESHOLD)):
            charset_name = max_prober.charset_name
            lower_charset_name = max_prober.charset_name.lower()
            confidence = max_prober.get_confidence()
            if lower_charset_name.startswith('iso-8859'):
                if self._has_win_bytes:
                    charset_name = self.ISO_WIN_MAP.get(lower_charset_name, charset_name)
            self.result = {'encoding': charset_name, 'confidence': confidence, 'language': max_prober.language}
    if (self.logger.getEffectiveLevel() == logging.DEBUG):
        if (self.result['encoding'] is None):
            self.logger.debug('no    probers    hit    minimum    threshold')
            for prober in self._charset_probers[0].probers:
                if (not prober):
                    continue
                self.logger.debug('%s    %s    confidence    =    %s', prober.charset_name, prober.language, prober.get_confidence())
    return self.result
