def METHOD_NAME(self, text):
    """Replace characters with their character entity references.
    Only characters corresponding to a named entity are replaced.
    """
    return str(text).translate(self.codepoint2entity)