Skip to content

Commit

Permalink
fix: 'CONGELADOS SALGADO' edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
iagocanalejas committed Apr 2, 2024
1 parent 66abaf6 commit 9612e04
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions rscraping/data/normalization/races.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
"CEFYCAL",
"FANDICOSTA",
"ONURA HOMES",
"SALGADO CONGELADOS",
"SALGADO",
"WOFCO",
"YURRITA GROUP",
"YURRITA",
Expand Down Expand Up @@ -62,6 +60,7 @@
"KEPA DEUN ARRANTZALEEN KOFRADÍA IKURRIÑA": [["COFRADÍA", "SAN", "PEDRO"], ["COFRADIA", "SAN", "PEDRO"]],
"MEMORIAL LAGAR": [["MEMORIAL", "MIGUEL", "LORES"]],
"MEMORIAL RULY": [["MEMORIAL", "RAUL", "REY"]],
"BANDEIRA CONGELADOS SALGADO": [["SALGADO"]],
}


Expand Down Expand Up @@ -155,6 +154,8 @@ def find_race_sponsor(name: str) -> str | None:
for sponsor in _KNOWN_RACE_SPONSORS:
if sponsor in name:
return sponsor
if "SALGADO" in name: # HACK: the race name is the sponsor name so we cannot replace it
return "SALGADO CONGELADOS"
return None


Expand Down
1 change: 1 addition & 0 deletions rscraping/data/normalization/towns.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
["TIRÁN"],
],
"BOIRO": [["CABO", "CRUZ"]],
"OLEIROS": [["PERILLO"]],
"O GROVE": [
["PEDRAS", "NEGRAS"],
["GROVE"],
Expand Down
2 changes: 1 addition & 1 deletion tests/parsers/df/tabular_parser_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def test_parse_race_names(self):
town=None,
organizer="CLUB DE REGATAS PERILLO",
sponsor="SALGADO CONGELADOS",
normalized_names=[("BANDEIRA PERILLO", 6)],
normalized_names=[("BANDEIRA CONGELADOS SALGADO", 6)],
race_ids=["4"],
url="test_url",
datasource=Datasource.TABULAR.value,
Expand Down

0 comments on commit 9612e04

Please sign in to comment.