""" Chemistry-related data for equation formatting. This module contains chemical elements, groups, and variables used for detecting and formatting chemistry equations. """ # Multi-character chemical elements (2 chars) # These are STRONG indicators - their presence alone triggers chemistry detection MULTI_CHAR_ELEMENTS = { # Period 2 'He', 'Li', 'Be', 'Ne', # Period 3 'Na', 'Mg', 'Al', 'Si', 'Cl', 'Ar', # Period 4 'Ca', 'Sc', 'Ti', 'Cr', 'Mn', 'Fe', 'Co', 'Ni', 'Cu', 'Zn', 'Ga', 'Ge', 'As', 'Se', 'Br', 'Kr', # Period 5 'Rb', 'Sr', 'Zr', 'Nb', 'Mo', 'Tc', 'Ru', 'Rh', 'Pd', 'Ag', 'Cd', 'In', 'Sn', 'Sb', 'Te', 'Xe', # Period 6 'Cs', 'Ba', 'La', 'Ce', 'Pr', 'Nd', 'Pm', 'Sm', 'Eu', 'Gd', 'Tb', 'Dy', 'Ho', 'Er', 'Tm', 'Yb', 'Lu', 'Hf', 'Ta', 'Re', 'Os', 'Ir', 'Pt', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Po', 'At', 'Rn', # Period 7 'Fr', 'Ra', 'Ac', 'Th', 'Pa', 'Np', 'Pu', 'Am', 'Cm', 'Bk', 'Cf', 'Es', 'Fm', 'Md', 'No', 'Lr', 'Rf', 'Db', 'Sg', 'Bh', 'Hs', 'Mt', 'Ds', 'Rg', 'Cn', 'Nh', 'Fl', 'Mc', 'Lv', 'Ts', 'Og' } # Single-character chemical elements (1 char) # These need CONTEXT - only formatted as chemistry when chemistry equation is detected SINGLE_CHAR_ELEMENTS = { 'H', # Hydrogen 'B', # Boron 'C', # Carbon 'N', # Nitrogen 'O', # Oxygen 'F', # Fluorine 'P', # Phosphorus 'S', # Sulfur 'K', # Potassium (but also common variable) 'V', # Vanadium (but also common variable for volume) 'Y', # Yttrium 'I', # Iodine 'W', # Tungsten 'U', # Uranium } # All chemical elements (for formatting once chemistry is detected) ALL_CHEMICAL_ELEMENTS = MULTI_CHAR_ELEMENTS | SINGLE_CHAR_ELEMENTS # Chemical groups and radicals (strong indicators) CHEMICAL_GROUPS = { 'OH', # Hydroxide 'SO', # Sulfite/Sulfate (partial) 'NO', # Nitrite/Nitrate (partial) 'CO', # Carbonyl/Carbonate (partial) 'NH', # Amine/Ammonium (partial) 'CH', # Methine/Hydrocarbon (partial) 'PO', # Phosphate (partial) 'ClO', # Chlorate (partial) } # Common chemistry variables (should stay italic even in chemistry equations) # These are NOT chemical elements, they're variables used in chemistry # NOTE: Keep this list minimal to avoid conflicts with fragmented elements CHEMISTRY_VARIABLES = { 'c', # Concentration # NOTE: 'n' removed - conflicts with fragmented Mn (Manganese) # NOTE: 'M' removed - conflicts with fragmented Mn, Mg (Magnesium) 'p', # Pressure (but P is Phosphorus!) 'T', # Temperature 'm', # Mass 'R', # Gas constant 'E', # Energy (but E is also used in chemistry) # NOTE: 'V' removed - conflicts with V (Vanadium) # NOTE: 'K' removed - conflicts with K (Potassium) # Generic math variables 'x', 'y', 'z', 'a', 'b', 'd', 'q', } # Chinese chemical conditions/terms CHINESE_CHEMICAL_TERMS = { '高温', # High temperature '加热', # Heating '催化剂', # Catalyst '点燃', # Ignition '电解', # Electrolysis '控温', # Temperature control '加压', # Pressurization '光照', # Light '通电', # Electrify }