|
@@ -357,7 +357,7 @@ def check_plural_word_in_wiktionary(word, html):
|
|
|
answer = None
|
|
answer = None
|
|
|
|
|
|
|
|
if '<title>{} — Викисловарь</title>'.format(word) in html:
|
|
if '<title>{} — Викисловарь</title>'.format(word) in html:
|
|
|
- answer = 'include'
|
|
|
|
|
|
|
+ answer = 'need include'
|
|
|
else:
|
|
else:
|
|
|
if '— Викисловарь</title>'.format(word) in html:
|
|
if '— Викисловарь</title>'.format(word) in html:
|
|
|
answer = 'exclude'
|
|
answer = 'exclude'
|
|
@@ -373,7 +373,7 @@ def check_plural_words_on_site():
|
|
|
dictionary = read_json()
|
|
dictionary = read_json()
|
|
|
i = 0
|
|
i = 0
|
|
|
for word, entry in dictionary.items():
|
|
for word, entry in dictionary.items():
|
|
|
- if 'answerNeedToIncludePlural' in entry and entry['answerNeedToIncludePlural'] not in ['include']:
|
|
|
|
|
|
|
+ if 'answerNeedToIncludePlural' in entry and entry['answerNeedToIncludePlural'] not in ['exclude']:
|
|
|
try:
|
|
try:
|
|
|
answer = check_word_in_site(word, url, function_check_html)
|
|
answer = check_word_in_site(word, url, function_check_html)
|
|
|
except requests.exceptions.ConnectionError:
|
|
except requests.exceptions.ConnectionError:
|
|
@@ -384,7 +384,7 @@ def check_plural_words_on_site():
|
|
|
print("Ошибка: Timeout")
|
|
print("Ошибка: Timeout")
|
|
|
time.sleep(10)
|
|
time.sleep(10)
|
|
|
save_json(dictionary)
|
|
save_json(dictionary)
|
|
|
- if answer in ['include', 'exclude']:
|
|
|
|
|
|
|
+ if answer in ['need include','include', 'exclude']:
|
|
|
dictionary[word]['answerNeedToIncludePlural'] = answer
|
|
dictionary[word]['answerNeedToIncludePlural'] = answer
|
|
|
i += 1
|
|
i += 1
|
|
|
if i % 100 == 0:
|
|
if i % 100 == 0:
|