Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for b in const_list.names_bibliography:
- if b.lower() in text.lower():
- test_text = text
- while test_text.lower().find(b.lower()) != -1:
- print(test_text)
- num = test_text.lower().find(b.lower())
- l_num = num + len(b)
- if (test_text[l_num] == ',') or (num - 2 > 0 and test_text[num - 2:num] == ', ') \
- or (l_num + 2 < len(test_text) and test_text[l_num: l_num + 2] == ' ('):
- test_text = test_text[l_num:]
- continue
- while l_num < len(test_text):
- if test_text[l_num] == ' ' or test_text[l_num] == ' ' or test_text[l_num] == '…' \
- or test_text[l_num:l_num + 2] == '..':
- if test_text[l_num:l_num + 2] == '..' or test_text[l_num] == '…':
- test_text = test_text[num + len(b):]
- break
- else:
- l_num += 1
- continue
- else:
- if test_text[l_num].isdigit() or (test_text[l_num].isalpha() and test_text[l_num].islower()):
- test_text = test_text[num + len(b):]
- break
- else:
- m_num = num - 1
- if test_text[m_num] == ' ' and test_text[m_num - 1].isalpha() \
- and test_text[m_num - 1].islower():
- test_text = test_text[num + len(b):]
- break
- if test_text[m_num-4:num] == ' ' and test_text[m_num - 5] == '.':
- test_text = test_text[num + len(b):]
- break
- while m_num >= 0:
- if test_text[m_num] == ' ' or test_text[m_num] == ' ' or test_text[m_num] == '\n':
- m_num -= 1
- continue
- else:
- if not test_text[m_num].isdigit():
- flag_bibliography = 0
- main += text[:(len(text) - len(test_text) + num)]
- text = test_text[num + len(b):]
- test_text = test_text[num + len(b):]
- break
- break
- if flag_bibliography == 0:
- break
- if flag_bibliography == 0:
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement