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)
评论列表
文章目录