补充缺页判断
This commit is contained in:
@@ -178,3 +178,22 @@ def parse_hospital(string):
|
||||
split_hospitals = string_without_company.replace('医院', '医院 ')
|
||||
result += split_hospitals.strip().split(' ')
|
||||
return result
|
||||
|
||||
|
||||
def parse_page_num(page_list):
|
||||
if not page_list:
|
||||
return None, None
|
||||
pages = []
|
||||
total = []
|
||||
for page in page_list:
|
||||
join = ''.join(page)
|
||||
numbers = re.findall(r'\d+', join)
|
||||
pages.append(min(numbers))
|
||||
total.append(max(numbers))
|
||||
return pages, max(total)
|
||||
|
||||
|
||||
def handle_tiny_int(num):
|
||||
if not num:
|
||||
return None
|
||||
return num if num <= 127 else 127
|
||||
|
||||
Reference in New Issue
Block a user