package ru.trader.store.imp;

import java.util.HashMap;
import java.util.Map;

public class ItemCorrector {
    private final static Map<String, String> IDS = new HashMap<>(85, 0.9f);


    static {
        IDS.put("explosives", "explosives");
        IDS.put("hydrogen fuel", "hydrogenfuel");
        IDS.put("mineral oil", "mineraloil");
        IDS.put("nerve agents", "nerve_agents");
        IDS.put("pesticides", "pesticides");
        IDS.put("surface stabilisers", "surface_stabilisers");
        IDS.put("synthetic reagents", "synthetic_reagents");
        IDS.put("clothing", "clothing");
        IDS.put("consumer technology", "consumertechnology");
        IDS.put("domestic appliances", "domesticappliances");
        IDS.put("evacuation shelter", "evacuation_shelter");
        IDS.put("algae", "algae");
        IDS.put("animal meat", "animalmeat");
        IDS.put("coffee", "coffee");
        IDS.put("energy drinks", "energydrinks");
        IDS.put("fish", "fish");
        IDS.put("food cartridges", "foodcartridges");
        IDS.put("fruit and vegetables", "fruitandvegetables");
        IDS.put("grain", "grain");
        IDS.put("synthetic meat", "syntheticmeat");
        IDS.put("tea", "tea");
        IDS.put("ceramic composites", "ceramic_composites");
        IDS.put("meta-alloys", "meta_alloys");
        IDS.put("polymers", "polymers");
        IDS.put("semiconductors", "semiconductors");
        IDS.put("superconductors", "superconductors");
        IDS.put("beer", "beer");
        IDS.put("bootleg liquor", "bootleg_liquor");
        IDS.put("liquor", "liquor");
        IDS.put("narcotics", "basicnarcotics");
        IDS.put("basic narcotics", "basicnarcotics");
        IDS.put("tobacco", "tobacco");
        IDS.put("wine", "wine");
        IDS.put("atmospheric processors", "atmosphericprocessors");
        IDS.put("atmospheric extractors", "atmosphericprocessors");
        IDS.put("building fabricators", "building_fabricators");
        IDS.put("crop harvesters", "cropharvesters");
        IDS.put("geological equipment", "geological_equipment");
        IDS.put("marine equipment", "marinesupplies");
        IDS.put("marine supplies", "marinesupplies");
        IDS.put("microbial furnaces", "microbialfurnaces");
        IDS.put("heliostatic furnaces", "microbialfurnaces");
        IDS.put("mineral extractors", "mineralextractors");
        IDS.put("power generators", "powergenerators");
        IDS.put("skimmer components", "skimer_components");
        IDS.put("thermal cooling units", "thermal_cooling_units");
        IDS.put("water purifiers", "waterpurifiers");
        IDS.put("agri-medicines", "agriculturalmedicines");
        IDS.put("agricultural medicines", "agriculturalmedicines");
        IDS.put("basic medicines", "basicmedicines");
        IDS.put("combat stabilisers", "combatstabilisers");
        IDS.put("performance enhancers", "performanceenhancers");
        IDS.put("progenitor cells", "progenitorcells");
        IDS.put("aluminium", "aluminium");
        IDS.put("beryllium", "beryllium");
        IDS.put("bismuth", "bismuth");
        IDS.put("cobalt", "cobalt");
        IDS.put("copper", "copper");
        IDS.put("gallium", "gallium");
        IDS.put("gold", "gold");
//        IDS.put("hafnium 178", "");
        IDS.put("indium", "indium");
        IDS.put("lanthanum", "lanthanum");
        IDS.put("lithium", "lithium");
        IDS.put("osmium", "osmium");
        IDS.put("palladium", "palladium");
        IDS.put("platinum", "platinum");
        IDS.put("tantalum", "tantalum");
        IDS.put("silver", "silver");
        IDS.put("thallium", "thallium");
        IDS.put("thorium", "thorium");
        IDS.put("titanium", "titanium");
        IDS.put("uranium", "uranium");
        IDS.put("bauxite", "bauxite");
        IDS.put("bertrandite", "bertrandite");
        IDS.put("coltan", "coltan");
        IDS.put("cryolite", "cryolite");
        IDS.put("gallite", "gallite");
        IDS.put("goslarite", "goslarite");
        IDS.put("indite", "indite");
        IDS.put("lepidolite", "lepidolite");
//        IDS.put("moissanite", "");
        IDS.put("painite", "painite");
        IDS.put("pyrophyllite", "pyrophyllite");
        IDS.put("rutile", "rutile");
//        IDS.put("taaffeite", "");
        IDS.put("uraninite", "uraninite");
//        IDS.put("ai relics", "");
//        IDS.put("ancient artefact", "");
//        IDS.put("antiquities", "");
//        IDS.put("encrypted data storage", "");
//        IDS.put("experimental chemicals", "");
//        IDS.put("military intelligence", "");
//        IDS.put("military plans", "");
//        IDS.put("prototype tech", "");
//        IDS.put("rebel transmissions", "");
        IDS.put("sap 8 core container", "sap8corecontainer");
//        IDS.put("technical blueprints", "");
//        IDS.put("trade data", "");
        IDS.put("imperial slaves", "imperialslaves");
        IDS.put("slaves", "slaves");
        IDS.put("advanced catalysers", "advancedcatalysers");
        IDS.put("animal monitors", "animalmonitors");
        IDS.put("aquaponic systems", "aquaponicsystems");
        IDS.put("auto-fabricators", "autofabricators");
        IDS.put("auto fabricators", "autofabricators");
        IDS.put("bioreducing lichen", "bioreducinglichen");
        IDS.put("bio reducing lichen", "bioreducinglichen");
        IDS.put("computer components", "computercomponents");
        IDS.put("h.e. suits", "hazardousenvironmentsuits");
        IDS.put("hazardous environment suits", "hazardousenvironmentsuits");
        IDS.put("land enrichment systems", "landenrichmentsystems");
        IDS.put("terrain enrichment systems", "landenrichmentsystems");
        IDS.put("muon imager", "mu_tom_imager");
        IDS.put("resonating separators", "resonatingseparators");
        IDS.put("robotics", "robotics");
        IDS.put("structural regulators", "structural_regulators");
        IDS.put("leather", "leather");
        IDS.put("natural fabrics", "naturalfabrics");
        IDS.put("synthetic fabrics", "syntheticfabrics");
        IDS.put("biowaste", "biowaste");
        IDS.put("chemical waste", "chemicalwaste");
        IDS.put("scrap", "scrap");
        IDS.put("battle weapons", "battleweapons");
        IDS.put("landmines", "landmines");
        IDS.put("non-lethal weapons", "nonlethalweapons");
        IDS.put("non lethal weapons", "nonlethalweapons");
        IDS.put("personal weapons", "personalweapons");
        IDS.put("reactive armour", "reactivearmour");

        IDS.put("hydrogen peroxide", "hydrogen_peroxide");
        IDS.put("liquid oxygen", "liquid_oxygen");
        IDS.put("water", "water");
        IDS.put("survival equipment", "survival_equipment");
        IDS.put("cmm composite", "cmm_composite");
        IDS.put("c m m composite", "cmm_composite");
        IDS.put("insulating membrane", "insulating_membrane");
        IDS.put("emergency power cells", "emergency_power_cells");
        IDS.put("exhaust manifold", "exhaust_manifold");
        IDS.put("hn shock mount", "hn_shock_mount");
        IDS.put("h n shock mount", "hn_shock_mount");
        IDS.put("advanced medicines", "advanced_medicines");
        IDS.put("praseodymium", "praseodymium");
        IDS.put("samarium", "samarium");
        IDS.put("low temperature diamond", "low_temperature_diamond");
        IDS.put("micro controllers", "micro_controllers");
        IDS.put("conductive fabrics", "conductive_fabrics");
        IDS.put("lithium hydroxide", "lithium_hydroxide");
        IDS.put("methane clathrate", "methane_clathrate");
        IDS.put("military grade fabrics", "military_grade_fabrics");
        IDS.put("heatsink interlink", "heatsink_interlink");
        IDS.put("magnetic emitter coil", "magnetic_emitter_coil");
        IDS.put("power converter", "power_converter");
        IDS.put("energy grid assembly", "power_grid_assembly");
        IDS.put("bromellite", "bromellite");
        IDS.put("methanol monohydrate", "methanol_monohydrate_crystals");
        IDS.put("hardware diagnostic sensor", "diagnostic_sensor");
        IDS.put("medical diagnostic equipment", "medical_diagnostic_equipment");
        IDS.put("reinforced mounting plate", "reinforced_mounting_plate");
        IDS.put("articulation motors", "articulation_motors");
        IDS.put("modular terminals", "modular_terminals");
        IDS.put("power transfer conduits", "power_transfer_conduits");
        IDS.put("radiation baffle", "radiation_baffle");
        IDS.put("ion distributor", "ion_distributor");
        IDS.put("nanobreakers", "nanobreakers");
        IDS.put("telemetry suite", "telemetry_suite");
        IDS.put("jadeite", "jadeite");
        IDS.put("moissanite", "moissanite");
        IDS.put("taaffeite", "taaffeite");
    }

    public static String getItemId(String name){
        name = name.toLowerCase();
        String id = IDS.get(name);
        return  id != null ? id : name.replace(" ","_");
    }
}
