refakotorálás előtti állapot
This commit is contained in:
24
backend/app/workers/vehicle/mapping_dictionary.py
Normal file
24
backend/app/workers/vehicle/mapping_dictionary.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# MB 2.0: Strukturált adat-szótár a források egységesítéséhez
|
||||
VEHICLE_MAPPING = {
|
||||
"os-vehicle-db": {
|
||||
"brand": "make",
|
||||
"model": "model",
|
||||
"year": "year",
|
||||
"specs": {
|
||||
"engine_hp": "specs.engine.hp",
|
||||
"fuel": "specs.engine.fuel",
|
||||
"body": "specs.body.type"
|
||||
}
|
||||
}
|
||||
# Ide jönnek majd a carquery és fipe mappolások
|
||||
}
|
||||
|
||||
def normalize_make(make: str) -> str:
|
||||
""" Egységes márkanevek (pl. Mercedes-Benz vs Mercedes) """
|
||||
m = make.upper().strip()
|
||||
synonyms = {
|
||||
"MERCEDES": "MERCEDES-BENZ",
|
||||
"VW": "VOLKSWAGEN",
|
||||
"ALFA": "ALFA ROMEO"
|
||||
}
|
||||
return synonyms.get(m, m)
|
||||
Reference in New Issue
Block a user