import logging

LOGGER = logging.getLogger("rara-tools-marc-parser")


class EMSMarcIDs:
    SYNONYMS = ["448", "450", "451", "455"]
    RELATED = ["548", "550", "551", "555"]
    CATEGORY = ["072"]
    NOTES = ["680"]
    URL = ["024"]
    TIME_KEYWORD = "148"
    TOPIC_KEYWORD = "150"
    LOC_KEYWORD = "151"
    GENRE_KEYWORD = "155"


class GeneralMarcIDs:
    ID = ["001"]
    ID_SOURCE = ["003"]


class OrganizationMarcIDs:
    NAME = ["110", "111"]
    NAME_VARIATIONS = ["410", "411"]
    RELATED_NAMES = ["510", "511"]
    SOURCE = ["667"]
    DESCRIPTION = ["680"]
    AREA_CODE = ["043"]


class PersonMarcIDs:
    NAME = ["100"]
    NAME_VARIATIONS = ["400"]
    SOURCE = ["670"]
    DESCRIPTION = ["680"]

class TitleMarcIDs:
    NAME = ["100"]
    NAME_VARIATIONS = ["400"]
    YEAR = ["046"]
    TYPE = ["075"]

class KeywordType:
    LOC = "Kohamärksõnad"
    TIME = "Ajamärksõnad"
    TOPIC = "Teemamärksõnad"
    GENRE = "Vormimärksõnad"

class EntityType:
    PER = "PER"
    ORG = "ORG"
    KEYWORD = "EMS_KEYWORD"
    LOC = "LOC"
    UNK = "UNKNOWN"


EN_SUBJECT_FIELDS = {
    "00": "GENERAL CONCEPTS",
    "01": "PHILOSOPHY. ETHICS. SEMIOTICS",
    "02": "RELIGION. THEOLOGY. ESOTERICISM",
    "03": "SCIENCE AND TECHNOLOGY",
    "04": "EDUCATION. PEDAGOGY",
    "06": "PSYCHOLOGY",
    "07": "SOCIOLOGY. SOCIAL PSYCHOLOGY",
    "08": "EMPLOYMENT. WORKING CONDITIONS. OCCUPATIONS",
    "10": "POLITOLOGY. POLITICS",
    "11": "GOVERNMENT. ADMINISTRATION. CIVIL DEFENCE. SECURITY SERVICE",
    "12": "SOCIAL POLICY",
    "13": "LAW. LEGISLATION",
    "15": "MILITARY AFFAIRS. ARMAMENT. MILITARY EQUIPMENT",
    "17": "DEMOGRAPHY. STATISTICS",
    "18": "JOURNALISM. COMMUNICATION. MEDIA. ADVERTISING",
    "19": "NATURE PROTECTION. ENVIRONMENT PROTECTION. ENVIRONMENT TECHY",
    "20": "GEOLOGY. HYDROLOGY. CLIMATOLOGY",
    "21": "MATHEMATICS",
    "22": "ASTRONOMY. ASTROPHYSICS. SPACE EXPLORATION",
    "23": "PHYSICS",
    "24": "CHEMISTRY. CHEMICAL INDUSTRY",
    "25": "BIOLOGY. MICROBIOLOGY. GENETICS. ANTHROPOLOGY",
    "26": "BOTANY",
    "27": "ZOOLOGY",
    "28": "MEDICINE. BIOCHEMISTRY. ANATOMY. PHYSIOLOGY. COSMETICS",
    "29": "ECONOMY. ECONOMICS. FINANCE. TRADE",
    "30": "AGRICULTURE. HORTICULTURE. ANIMAL BREEDING. VETERINARY",
    "31": "FORESTRY. HUNTING. FISHERY. FOREST AND WOODWORK INDUSTRY. PULP AND PAPER INDUSTRY",
    "34": "CATERING. DOMESTIC ECONOMY",
    "35": "ELECTRICAL TECHNOLOGY. ELECTRONICS. ENERGETICS",
    "36": "INFORMATICS. INFORMATION TECHNOLOGY. AUTOMATICS",
    "39": "MECHANICAL ENGINEERING. METAL INDUSTRY. METALLURGY. MINING",
    "43": "LIGHT INDUSTRY. TEXTILE INDUSTRY. LEATHER INDUSTRY",
    "44": "BUILDING. CONSTRUCTION. SANITARY ENGINEERING",
    "45": "TRAFFIC. TRANSPORT. COMMUNICATION",
    "47": "ART. ARCHITECTURE",
    "48": "PHOTOGRAPHY. CINEMA",
    "49": "MUSIC",
    "50": "THEATRE. DANCE",
    "51": "SPORTS. PHYSICAL CULTURE",
    "52": "HOBBIES. LEISURE ACTIVITIES",
    "53": "INFORMATION SCIENCE. LIBRARIANSHIP. MEMORY INSTITUTIONS. PUBLISHING. TYPOGRAPHY",
    "54": "LINGUISTICS. LANGUAGES",
    "55": "LITERARY SCIENCE. LITERATURE. FOLKLORE",
    "56": "HISTORY. ARCHAEOLOGY",
    "58": "ETHNOLOGY. CULTURAL ANTHROPOLOGY",
    "59": "GEOGRAPHY. GEODESY. CARTOGRAPHY",
    "60": "GEOGRAPHICAL NAMES"
}

ET_SUBJECT_FIELDS = {
    "00": "ÜLDMÕISTED",
    "01": "FILOSOOFIA. EETIKA. SEMIOOTIKA",
    "02": "RELIGIOON. TEOLOOGIA. ESOTEERIKA",
    "03": "TEADUS JA TEHNIKA. TEADUSKORRALDUS. TEADUSMETODOLOOGIA. KULTUUR",
    "04": "HARIDUS. PEDAGOOGIKA",
    "06": "PSÜHHOLOOGIA",
    "07": "SOTSIOLOOGIA. SOTSIAALPSÜHHOLOOGIA",
    "08": "TÖÖHÕIVE. TÖÖTINGIMUSED. AMETID",
    "10": "RIIGIÕPETUS. POLIITIKA",
    "11": "VALITSUS. HALDUS. KODANIKUKAITSE. TURVATEENISTUS",
    "12": "SOTSIAALPOLIITIKA",
    "13": "ÕIGUS",
    "15": "SÕJANDUS. RELVAJÕUD. SÕJATEHNIKA",
    "17": "DEMOGRAAFIA. STATISTIKA",
    "18": "AJAKIRJANDUS. KOMMUNIKATSIOON. MEEDIA. REKLAAM",
    "19": "LOODUSKAITSE. KESKKONNAKAITSE. KESKKONNATEHNIKA",
    "20": "GEOLOOGIA. HÜDROLOOGIA. KLIMATOLOOGIA",
    "21": "MATEMAATIKA",
    "22": "ASTRONOOMIA. ASTROFÜÜSIKA. KOSMOSEUURIMINE",
    "23": "FÜÜSIKA",
    "24": "KEEMIA. KEEMIATÖÖSTUS",
    "25": "BIOLOOGIA. MIKROBIOLOOGIA. GENEETIKA. ANTROPOLOOGIA",
    "26": "BOTAANIKA",
    "27": "ZOOLOOGIA",
    "28": "MEDITSIIN. BIOKEEMIA. ANATOOMIA. FÜSIOLOOGIA. FARMAKOLOOGIA. KOSMEETIKA",
    "29": "MAJANDUS. MAJANDUSTEADUS. RAHANDUS. KAUBANDUS",
    "30": "PÕLLUMAJANDUS. AIANDUS. LOOMAKASVATUS. VETERINAARIA",
    "31": "METSANDUS. JAHINDUS. KALANDUS. METSA- JA PUIDUTÖÖSTUS. TSELLULOOSI- JA PABERITÖÖSTUS",
    "34": "KODUMAJANDUS. TOIDUAINETETÖÖSTUS. TOITLUSTUS. OLME",
    "35": "ELEKTROTEHNIKA. ELEKTROONIKA. ENERGEETIKA",
    "36": "INFORMAATIKA. INFOTEHNOLOOGIA. AUTOMAATIKA",
    "39": "MASINAEHITUS. METALLITÖÖSTUS. METALLURGIA. MÄENDUS",
    "43": "KERGETÖÖSTUS. TEKSTIILITÖÖSTUS. NAHA- JA JALATSITÖÖSTUS",
    "44": "EHITUS. SANITAARTEHNIKA",
    "45": "LIIKLUS. TRANSPORT. SIDE",
    "47": "KUNST. ARHITEKTUUR",
    "48": "FOTOGRAAFIA. FILM. KINO",
    "49": "MUUSIKA",
    "50": "TEATER. TANTS",
    "51": "SPORT. KEHAKULTUUR",
    "52": "HARRASTUSED. VABA AEG",
    "53": "INFOTEADUS. RAAMATUKOGUNDUS. MÄLUASUTUSED. KIRJASTAMINE. TRÜKINDUS",
    "54": "KEELETEADUS. KEELED",
    "55": "KIRJANDUSTEADUS. ILUKIRJANDUS. RAHVALUULE",
    "56": "AJALUGU. ARHEOLOOGIA",
    "58": "ETNOLOOGIA. KULTUURIANTROPOLOOGIA",
    "59": "GEOGRAAFIA. GEODEESIA. KARTOGRAAFIA",
    "60": "KOHANIMED"
}
