def extract(self, post, extracted=None):
    target_count = len(re.findall('\\$.*?\\$+', post.rendered_body))
    lines_count = len(self.text.split('。'))
    ratio = ((target_count / lines_count) if (target_count != 0) else 0)
    return ratio
def extract(self, post, extracted=None):
    target_count = len(re.findall('\\$.*?\\$+', post.rendered_body))
    lines_count = len(self.text.split('。'))
    ratio = ((target_count / lines_count) if (target_count != 0) else 0)
    return ratio