|
|
|
@ -22,6 +22,7 @@ from DataGatherers.cache_manager import CacheManager |
|
|
|
import concurrent.futures |
|
|
|
from concurrent.futures import ThreadPoolExecutor, as_completed |
|
|
|
from functools import lru_cache |
|
|
|
from pattern.en import singularize |
|
|
|
|
|
|
|
from DataGatherers.constants import all_games, regional_descriptors |
|
|
|
|
|
|
|
@ -391,7 +392,7 @@ def parse_form_information(html_content): |
|
|
|
form_text = form_text.strip('()') |
|
|
|
|
|
|
|
if "/" in form_text: |
|
|
|
last_word = form_text.split()[-1] |
|
|
|
last_word = singularize(form_text.split()[-1]) |
|
|
|
form_text = form_text.replace(last_word, "").strip() |
|
|
|
parts = form_text.split('/') |
|
|
|
for part in parts: |
|
|
|
@ -724,6 +725,10 @@ def process_game_locations(raw_game, raw_locations, form, default_forms): |
|
|
|
for form_info in forms: |
|
|
|
if form_matches(form_info, form, default_forms): |
|
|
|
locations.append({"location": raw_text, "tag": raw_location}) |
|
|
|
else: |
|
|
|
form_info = {"main_form": None, "sub_form": None, "region": None} |
|
|
|
if form_matches(form_info, form, default_forms): |
|
|
|
locations.append({"location": raw_text, "tag": raw_location}) |
|
|
|
|
|
|
|
return locations if locations else None |
|
|
|
|
|
|
|
@ -738,6 +743,9 @@ def form_matches(form_info, form, default_forms): |
|
|
|
if default_forms and main_form and main_form in default_forms: |
|
|
|
main_form = None |
|
|
|
|
|
|
|
if form.lower() in ["spring form", "summer form", "autumn form", "winter form"] and main_form == None: |
|
|
|
return True |
|
|
|
|
|
|
|
if main_form is None: |
|
|
|
return False |
|
|
|
|
|
|
|
|