html_utils.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:audio-feeder 作者: pganssle 项目源码 文件源码
def get_unstripped_pos(self, pos):
        """
        After the feed has been processed.

        :param pos:
            The position of the "stripped" tag

        :return:
            Returns the position in the "unstripped" string.
        """
        # Find out which segment we're in - always get the position to the
        # right of the one we want to be in.
        max_pos = self.pos_counts[-1][1]
        pos_counts_pos = bisect.bisect_right(self.pos_counts, (pos, max_pos))
        pos_counts_pos -= 1

        stripped_base, unstripped_base = self.pos_counts[pos_counts_pos]

        return unstripped_base + (pos - stripped_base)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号