def text_weight(self, elem):
        content_score = 1
        long_text_line = 0
        block_size = 3
        inner_text = ""
        for string in elem.stripped_strings:
            if (self.is_foreign and len(string) > 100) or (not self.is_foreign and len(string) > 50):
                long_text_line += 1
                inner_text += string
            else:
                inner_text += string
        """for punch"""
        if len(inner_text) > 0:
            if self.is_foreign:
                splits = re.split(u",|\.|\?", inner_text)
                content_score += len(splits)
            else:
                splits = re.split(u"|，|。|？", inner_text)
                content_score += len(splits)
        """for text len"""
        if self.is_foreign:
            content_score += min((len(inner_text) / 100), 5)
        else:
            content_score += min((len(inner_text) / 20), 5)

        """for text block"""
        block_array = map(len, elem.strings)
        block_set = []
        for i in range(0, len(block_array) - block_size):
            block_text_len = 0
            for j in range(i, i + block_size):
                block_text_len += (block_array[j] - 1)
            block_set.append(block_text_len)
        short_block = 0
        blk_text_len = 0
        for block in block_set:
            blk_text_len += block
            if (self.is_foreign and block < 50) or (not self.is_foreign and block < 10):
                short_block += 1
        short_block_ratio = float(short_block) / max(len(block_set), 1)
        if short_block_ratio > 0.3:
            content_score -= 10
        return content_score