'Stop analyzing the current document and come up with a final
prediction.
:returns:  The ``result`` attribute if a prediction was made, otherwise
``None``.'

def close(self):

    if self.done:
        return self.result
    if (not self._got_data):
        self.logger.debug('no    data    received!')
        return
    self.done = True
    if (self._input_state == InputState.pure_ascii):
        self.result = {'encoding': 'ascii', 'confidence': 1.0}
        return self.result
    if (self._input_state == InputState.high_byte):
        proberConfidence = None
        max_prober_confidence = 0.0
        max_prober = None
        for prober in self._charset_probers:
            if (not prober):
                continue
            proberConfidence = prober.get_confidence()
            if (proberConfidence > max_prober_confidence):
                max_prober_confidence = proberConfidence
                max_prober = prober
        if (max_prober and (max_prober_confidence > self.MINIMUM_THRESHOLD)):
            self.result = {'encoding': max_prober.charset_name, 'confidence': max_prober.get_confidence()}
            return self.result
    if (self.logger.getEffectiveLevel() == logging.DEBUG):
        self.logger.debug('no    probers    hit    minimum    threshhold')
        for prober in self._charset_probers[0].mProbers:
            if (not prober):
                continue
            self.logger.debug('%s    confidence    =    %s', prober.charset_name, prober.get_confidence())
