def parse_cited_numeric(self, citation_str):
cited = []
citation_str = citation_str[1:-1] # Remove surrounding brackets []
cids = map(string.strip, citation_str.split(","))
for cid in cids :
# Check if the range kind of e.g. [1-4] or not
if cid.find('-')<0 :
cited.append(cid)
else :
start, end = cid.split('-')
cited_range = range(int(start.strip()), int(end.strip())+1)
cited.extend(map(str, cited_range))
return cited
评论列表
文章目录