From b61fb38724f36e79a94991985886cf4978c1dfad Mon Sep 17 00:00:00 2001 From: Katarzyna Rachwal Date: Mon, 19 Feb 2024 11:46:54 -0500 Subject: [PATCH] need to string match more specific constant keys before less specific ones --- react-frontend/src/lib/constants.ts | 139 ++++++++++++++-------------- 1 file changed, 70 insertions(+), 69 deletions(-) diff --git a/react-frontend/src/lib/constants.ts b/react-frontend/src/lib/constants.ts index 0046967..774d76a 100644 --- a/react-frontend/src/lib/constants.ts +++ b/react-frontend/src/lib/constants.ts @@ -4,91 +4,92 @@ interface Constant { } // See https://github.com/RamanujanMachine/LIReC/blob/main/LIReC/lib/calculator.py for each of the following keys +// make sure these are alpha sorted because otherwise e.g. alpha will be replaced instead of alpha_GW const constants: {[abbrev: string]: Constant } = { - "sqrt2": {"replacement": "sqrt(2)"}, - "sqrt3": {"replacement": "sqrt(3)"}, - "phi": {"name": "Golden Ratio"}, + "alpha_GW": {"name": "Goemans Williamson Constant", "replacement": "α[GW]"}, + "alpha_M": {"name": "Madelung Constant", "replacement": "α[M]"}, + "alpha_F": {"name": "Foias Constant", "replacement": "α[F]"}, + "alpha": {"name": "Second Feigenbaum Constant", "replacement": "α"}, + "A_Pi": {"name": "Mills Constant", "replacement": "A[π]"}, + "A": {"name": "Glaisher Kinkelin Constant"}, + "beta_Levy": {"name": "First Lévy Constant", "replacement": "β"}, + "beta": {"name": "Bernstein Constant", "replacement": "β"}, + "B_2": {"name": "Brun Constant", "replacement": "B[2]"}, + "B_H": {"name": "Backhouse Constant", "replacement": "B[H]"}, "cbrt2": {"replacement": "cbrt(2)"}, "cbrt3": {"replacement": "cbrt(3)"}, - "root12of2": {"replacement": "nthRoot(2, 12)"}, - "psi": {"replacement": "ψ", "name": "Super Golden Ratio"}, - "mu": {"replacement": "μ", "name": "Hexagonal Lattice Connective Constant"}, - "Kprime": {"replacement": "Κ","name": "Kepler Bouwkamp Constant"}, - "W": {"name": "Wallis Constant"}, - "ln2": {"replacement": "ln(2)"}, - "G_025": {"replacement": "Γ(0.25)"}, - "gamma": {"name": "Euler Mascheroni Constant"}, - "E": {"name": "Erdos Borwein constant"}, - "Omega": {"replacement": "Ω","name": "Omega Constant"}, - "Zeta3": {"replacement": "ζ(3)", "name": "Apery Constant"}, - "L_lim": {"name": "Laplace Limit", "replacement": "L[lim]"}, - "R_S": {"name": "Ramanujan Soldner Constant", "replacement": "R[S]"}, - "G": {"name": "Gauss Constant (ϖ/π)"}, - "L_1": {"name": "First Lemniscate Constant (ϖ/2)", "replacement": "L[1]"}, - "L_2": {"name": "Secnd Lemniscate Constant (π/(2ϖ))", "replacement": "L[2]"}, - "L": {"name": "Liouville Constant"}, + "C_Artin": {"name": "Artin Constant", "replacement": "C[Artin]"}, + "C_HBM": {"name": "Heath-Brown–Moroz Constant", "replacement": "C[HBM]"}, + "C_CE": {"name": "Copeland Erdős Constant", "replacement": "C[CE]"}, + "C_FT": {"name": "Feller Tornier Constant", "replacement": "C[FT]"}, + "C_10": {"name": "Base 10 Champernowne Constant", "replacement": "C[10]"}, "C_1": {"name": "First Continued Fraction Constant", "replacement": "C[1]"}, - "R": {"name": "Ramanujan Constant"}, - "A": {"name": "Glaisher Kinkelin Constant"}, + "C_N": {"name": "Niven Constant", "replacement": "C[N]"}, + "C_P": {"name": "Porter Constant", "replacement": "C[P]"}, + "C_2": {"name": "Second du Bois-Reymond Constant", "replacement": "C[2]"}, "C": {"name": "Catalan Constant"}, + "c": {"name": "Asymptotic Lebesgue Constant", "replacement": "Λ[n]"}, + "delta_ETF": {"name": "Erdős-Tenenbaum-Ford Constant", "replacement": "δ[ETF]"}, + "delta_G": {"name": "Gompertz Constant", "replacement": "δ[G]"}, + "Delta_3": {"name": "Robbins Constant", "replacement": "∆(3)"}, + "delta": {"name": "First Feigenbaum Constant", "replacement": "δ"}, + "D_V": {"name": "Devicci Tesseract Constant", "replacement": "D[V]"}, "D": {"name": "Dottie Number"}, - "M": {"name": "Meissel Mertens Constant"}, - "P": {"name": "Universal Parabolic Constant"}, + "eLevy": {"name": "Second Lévy Constant", "replacement": "e^β"}, "epi": {"name": "Gelfond Constant", "replacement": "e^π"}, + "E": {"name": "Erdos Borwein constant"}, + "F": {"name": "Fransén Robinson Constant"}, + "gamma": {"name": "Euler Mascheroni Constant"}, + "G_025": {"replacement": "Γ(0.25)"}, + "G_L": {"name": "Gieseking Constant or Lobachevsky Constant", "replacement": "G[L]"}, "G_S": {"name": "Gelfond-Schneider Constant or Hilbert Number", "replacement": "2^sqrt(2)"}, "g": {"name": "Golden Angle"}, - "S": {"name": "Sierpiński Constant"}, - "L_R": {"name": "Landau Ramanujan Constant", "replacement": "L[R]"}, - "G_L": {"name": "Gieseking Constant or Lobachevsky Constant", "replacement": "G[L]"}, - "beta": {"name": "Bernstein Constant", "replacement": "β"}, - "T": {"name": "Tribonacci Constant", "replacement": "η"}, - "B_2": {"name": "Brun Constant", "replacement": "B[2]"}, - "Pi_2": {"name": "Twin Primes Constant", "replacement": "Π[2]"}, - "rho": {"name": "Plastic Number", "replacement": "Ρ"}, - "z_975": {"name": "Z Score for 97.5 Percentile Point", "replacement": "z[97.5]"}, - "tau": {"name": "Prouhet Thue Morse Constant", "replacement": "τ"}, - "lambda_GD": {"name": "Golomb Dickman Constant", "replacement": "λ[GD]"}, - "c": {"name": "Asymptotic Lebesgue Constant", "replacement": "Λ[n]"}, - "C_FT": {"name": "Feller Tornier Constant", "replacement": "C[FT]"}, - "C_10": {"name": "Base 10 Champernowne Constant", "replacement": "C[10]"}, - "sigma_10": {"name": "Salem Constant", "replacement": "σ[10]"}, + "G": {"name": "Gauss Constant (ϖ/π)"}, + "Kprime": {"replacement": "Κ","name": "Kepler Bouwkamp Constant"}, "K_0": {"name": "Khinchin Constant", "replacement": "K[0]"}, - "beta_Levy": {"name": "First Lévy Constant", "replacement": "β"}, - "eLevy": {"name": "Second Lévy Constant", "replacement": "e^β"}, - "C_CE": {"name": "Copeland Erdős Constant", "replacement": "C[CE]"}, - "A_Pi": {"name": "Mills Constant", "replacement": "A[π]"}, - "delta_G": {"name": "Gompertz Constant", "replacement": "δ[G]"}, - "V_dp": {"name": "Van der Pauw Constant", "replacement": "π/ln(2)"}, - "theta_m": {"name": "Magic Angle", "replacement": "θ[m]"}, - "C_Artin": {"name": "Artin Constant", "replacement": "C[Artin]"}, - "C_P": {"name": "Porter Constant", "replacement": "C[P]"}, + "lambda_GD": {"name": "Golomb Dickman Constant", "replacement": "λ[GD]"}, + "lambda_C": {"name": "Conway Constant", "replacement": "λ[C]"}, + "ln2": {"replacement": "ln(2)"}, + "L_lim": {"name": "Laplace Limit", "replacement": "L[lim]"}, "L_Lochs": {"name": "Loch Constant", "replacement": "L[Lochs]"}, - "D_V": {"name": "Devicci Tesseract Constant", "replacement": "D[V]"}, - "C_N": {"name": "Niven Constant", "replacement": "C[N]"}, - "S_Pi": {"name": "Stephens Constant", "replacement": "S[Pi]"}, - "P_Dragon": {"name": "Paperfolding Constant", "replacement": "P[Dragon]"}, + "L_1": {"name": "First Lemniscate Constant (ϖ/2)", "replacement": "L[1]"}, + "L_2": {"name": "Secnd Lemniscate Constant (π/(2ϖ))", "replacement": "L[2]"}, + "L_R": {"name": "Landau Ramanujan Constant", "replacement": "L[R]"}, + "L_D": {"name": "Logarithmic Capacity of the Unit Disk", "replacement": "L[D]"}, + "L": {"name": "Liouville Constant"}, + "mu": {"replacement": "μ", "name": "Hexagonal Lattice Connective Constant"}, + "M": {"name": "Meissel Mertens Constant"}, + "Omega": {"replacement": "Ω","name": "Omega Constant"}, + "phi": {"name": "Golden Ratio"}, "psi_Fib": {"name": "Reciprocal Fibonacci Constant", "replacement": "ψ[Fib]"}, - "delta": {"name": "First Feigenbaum Constant", "replacement": "δ"}, - "Delta_3": {"name": "Robbins Constant", "replacement": "∆(3)"}, - "W_S": {"name": "Weierstrass Constant", "replacement": "W[S]"}, - "F": {"name": "Fransén Robinson Constant"}, - "alpha": {"name": "Second Feigenbaum Constant", "replacement": "α"}, - "C_2": {"name": "Second du Bois-Reymond Constant", "replacement": "C[2]"}, - "delta_ETF": {"name": "Erdős-Tenenbaum-Ford Constant", "replacement": "δ[ETF]"}, - "lambda_C": {"name": "Conway Constant", "replacement": "λ[C]"}, - "sigma": {"name": "Hafner-Sarnak-McCurley Constant", "replacement": "σ"}, - "B_H": {"name": "Backhouse Constant", "replacement": "B[H]"}, - "V": {"name": "Viswanath Constant"}, + "psi": {"replacement": "ψ", "name": "Super Golden Ratio"}, + "Pi_2": {"name": "Twin Primes Constant", "replacement": "Π[2]"}, + "P_Dragon": {"name": "Paperfolding Constant", "replacement": "P[Dragon]"}, + "P": {"name": "Universal Parabolic Constant"}, "q": {"name": "Komornik–Loreti Constant"}, - "C_HBM": {"name": "Heath-Brown–Moroz Constant", "replacement": "C[HBM]"}, - "S_MRB": {"name": "MRB Constant", "replacement": "S[MRB]"}, + "root12of2": {"replacement": "nthRoot(2, 12)"}, "rho_Pi": {"name": "Prime Constant", "replacement": "ρ[Pi]"}, + "rho": {"name": "Plastic Number", "replacement": "Ρ"}, + "R_S": {"name": "Ramanujan Soldner Constant", "replacement": "R[S]"}, + "R": {"name": "Ramanujan Constant"}, + "sigma_10": {"name": "Salem Constant", "replacement": "σ[10]"}, "sigma_S": {"name": "Somos Quadratic Recurrence Constant", "replacement": "σ[S]"}, - "alpha_F": {"name": "Foias Constant", "replacement": "α[F]"}, - "L_D": {"name": "Logarithmic Capacity of the Unit Disk", "replacement": "L[D]"}, + "sigma": {"name": "Hafner-Sarnak-McCurley Constant", "replacement": "σ"}, + "sqrt2": {"replacement": "sqrt(2)"}, + "sqrt3": {"replacement": "sqrt(3)"}, + "S_MRB": {"name": "MRB Constant", "replacement": "S[MRB]"}, + "S_Pi": {"name": "Stephens Constant", "replacement": "S[Pi]"}, + "S": {"name": "Sierpiński Constant"}, + "theta_m": {"name": "Magic Angle", "replacement": "θ[m]"}, + "tau": {"name": "Prouhet Thue Morse Constant", "replacement": "τ"}, "T_Pi": {"name": "Taniguchi Constant", "replacement": "T[Pi]"}, - "alpha_GW": {"name": "Goemans Williamson Constant", "replacement": "α[GW]"}, - "alpha_M": {"name": "Madelung Constant", "replacement": "α[M]"} + "T": {"name": "Tribonacci Constant", "replacement": "η"}, + "V_dp": {"name": "Van der Pauw Constant", "replacement": "π/ln(2)"}, + "V": {"name": "Viswanath Constant"}, + "W_S": {"name": "Weierstrass Constant", "replacement": "W[S]"}, + "W": {"name": "Wallis Constant"}, + "Zeta3": {"replacement": "ζ(3)", "name": "Apery Constant"}, + "z_975": {"name": "Z Score for 97.5 Percentile Point", "replacement": "z[97.5]"} }; export default constants; \ No newline at end of file