elements.py 文件源码

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

项目:ChemDataExtractor 作者: mcs07 项目源码 文件源码
def scan(self, tokens, max_matches=six.MAXSIZE, overlap=False):
        """"""
        if not self.streamlined:
            self.streamline()
        matches = 0
        i = 0
        length = len(tokens)
        while i < length and matches < max_matches:
            try:
                results, next_i = self.parse(tokens, i)
            except ParseException as err:
                i += 1
            else:
                if next_i > i:
                    matches += 1
                    if len(results) == 1:
                        results = results[0]
                    yield results, i, next_i
                    if overlap:
                        i += 1
                    else:
                        i = next_i
                else:
                    i += 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号