'Return the dictionary generated from the given html string;
getRefs can be used to force the gathering of movies/persons/characters
references.'

def parse(self, html_string, getRefs=None, **kwds):

    self.reset()
    if (getRefs is not None):
        self.getRefs = getRefs
    else:
        self.getRefs = self._defGetRefs
    if (not isinstance(html_string, unicode)):
        html_string = unicode(html_string, 'latin_1', 'replace')
    html_string = subXMLRefs(html_string)
    html_string = self.preprocess_string(html_string)
    html_string = html_string.strip()
    if (self.usingModule == 'beautifulsoup'):
        html_string = html_string.replace('""', '"')
        html_string = html_string.replace('<!--[if    IE]>', '"')
        html_string = html_string.replace('<![endif]-->', '"')
    if html_string:
        dom = self.get_dom(html_string)
        try:
            dom = self.preprocess_dom(dom)
        except Exception as e:
            self._logger.error('%s:    caught    exception    preprocessing    DOM', self._cname, exc_info=True)
        if self.getRefs:
            try:
                self.gather_refs(dom)
            except Exception as e:
                self._logger.warn('%s:    unable    to    gather    refs:    %s', self._cname, exc_info=True)
        data = self.parse_dom(dom)
    else:
        data = {}
    try:
        data = self.postprocess_data(data)
    except Exception as e:
        self._logger.error('%s:    caught    exception    postprocessing    data', self._cname, exc_info=True)
    if self._containsObjects:
        self.set_objects_params(data)
    data = self.add_refs(data)
    return data
