Class: Plurimath::Mathml::Constants
- Inherits:
-
Object
- Object
- Plurimath::Mathml::Constants
- Defined in:
- lib/plurimath/mathml/constants.rb
Constant Summary collapse
- UNICODE_SYMBOLS =
{ "α": "alpha", "β": "beta", "γ": "gamma", "Γ": "Gamma", "δ": "delta", "Δ": "Delta", "∆": "increment", "ε": "epsilon", "ɛ": "varepsilon", "ζ": "zeta", "η": "eta", "θ": "theta", "Θ": "Theta", "ϑ": "vartheta", "ι": "iota", "κ": "kappa", "λ": "lambda", "Λ": "Lambda", "μ": "mu", "ν": "nu", "ξ": "xi", "Ξ": "Xi", "π": "pi", "Π": "Pi", "ρ": "rho", "ς": "varsigma", "σ": "sigma", "Σ": "Sigma", "τ": "tau", "υ": "upsilon", "φ": "phi", "Φ": "Phi", "ϕ": "varphi", "χ": "chi", "ψ": "psi", "Ψ": "Psi", "ω": "omega", "Ω": "Omega", "⋅": "cdot", "∙": "*", ".": ".", "∗": "**", "⋆": "***", "×": "xx", "⋉": "|><", "⋊": "><|", "⋈": "|><|", "÷": "-:", "∘": "@", "⊕": "o+", "⨁": "o+", "⊗": "ox", "⊙": " ", "∑": "sum", "∏": "prod", "∧": "^^", "⋀": "^^^", "∨": "vv", "⋁": "vvv", "∩": "nn", "⋂": "nnn", "∪": "cup", "⋃": "uuu", "≠": "!=", "≤": "<=", "≥": ">=", "≺": "-<", "≻": ">-", "⪯": "-<=", "⪰": " >-=", "∈": "in", "∉": "!in", "⊂": "sub", "⊃": "sup", "⊆": "sube", "⊇": "supe", "≡": "-=", "≅": "~=", "≈": "~~", "∝": "prop", "¬": "not", "∀": "AA", "∃": "EE", "⊥": "_|_", "⊤": "TT", "⊢": "|--", "⊨": "|==", "〈": "<<", "〉": ">>", "∫": "int", "∮": "oint", "∂": "del", "∇": "grad", "±": "+-", "∅": "O/", "∞": "oo", "ℵ": "aleph", "∴": ":.", "∵": ":'", "∠": "/_", "△": "/_\\", "′": "'", "  ": "quad", "    ": "qquad", "‾": "overline", "⌢": "frown", "⋯": "cdots", "⋮": "vdots", "⋱": "ddots", "⋄": "diamond", "□": "square", "⌊": "|__", "⌋": "__|", "⌈": "|~", "⌉": "~|", "ℂ": "CC", "ℕ": "NN", "ℚ": "QQ", "ℝ": "RR", "ℤ": "ZZ", "↑": "uarr", "↓": "darr", "←": "larr", "↔": "harr", "⇒": "rArr", "⇐": "lArr", "⇔": "hArr", "↣": ">->", "↠": "->>", "⤖": ">->>", "↦": "|->", "…": "...", "−": "-", "⏞": "obrace", "⏟": "ubrace", "→": "vec", "̂": "hat", "̅": "bar", "⃡": "overleftrightarrow", "̲": "ul", "¯": "bar", "&": "&", ">": ">", "<": "<", "&": "&", "~": "tilde", "..": "ddot", "^": "hat", "¯": "bar", _: "ul", }.freeze
- CONTEXTUAL_ACCENT_FUNCTIONS =
Accent characters promoted to their function class ONLY in an accent position (MathML
, OMML <m:acc>). Kept separate from UNICODE_SYMBOLS because Text#value= consumes that map as a global substitution table, so an entry there would also rewrite the character inside ordinary text runs and bare tokens. { "̃": "tilde", }.freeze
- SYMBOLS =
{ "|": "|", "/": "//", "\\": "\\\\", "~": "tilde", "(": "(", ")": ")", "(:": "(:", ":)": ":)", "{": "{", "}": "}", "{:": "{:", ":}": ":}", "]": "]", "[": "[", "=": "=", "+": "+", "-": "-", }.freeze
- NAMED_FUNCTION_WORDS =
Named operators that have no dedicated MathML/OMML representation — no unicode character and no structural element — so a bare
/ /<m:t> word (e.g. sin , <m:t>min</m:t>) is their only written form and resolves to the function class. Every other CLASSES entry has a proper form — a diacritic character (bar/hat/vec via), a unicode symbol (sum/prod/int via ∑ etc.), or a structural element (frac via /<m:f>, sqrt via ) — so its bare word is a literal identifier, not the function. See PR #450 (which introduced this for accents). %w[ arccos arcsin arctan sin cos tan sec csc cot sinh cosh tanh coth sech csch log ln exp det dim gcd lcm glb lub max min mod ].freeze
- CLASSES =
%w[ mathfrak underset stackrel overline overset overleftrightarrow mathcal arccos arcsin arctan mathsf mathbb mathbf mathtt ubrace obrace cancel tilde floor color frac root oint ceil ddot coth csch sech sinh tanh cosh sqrt norm text prod sec int sin tan cos sum exp gcd glb lcm lub cot csc det dim max min abs bar dot hat vec mod log ul ln ].freeze
- SUPPORTED_FONT_STYLES =
{ "sans-serif-bold-italic": Math::Function::FontStyle::SansSerifBoldItalic, "sans-serif-italic": Math::Function::FontStyle::SansSerifItalic, "bold-sans-serif": Math::Function::FontStyle::BoldSansSerif, "double-struck": Math::Function::FontStyle::DoubleStruck, "bold-fraktur": Math::Function::FontStyle::BoldFraktur, "bold-italic": Math::Function::FontStyle::BoldItalic, "bold-script": Math::Function::FontStyle::BoldScript, "sans-serif": Math::Function::FontStyle::SansSerif, monospace: Math::Function::FontStyle::Monospace, fraktur: Math::Function::FontStyle::Fraktur, normal: Math::Function::FontStyle::Normal, script: Math::Function::FontStyle::Script, italic: Math::Function::FontStyle::Italic, bold: Math::Function::FontStyle::Bold, }.freeze
Class Method Summary collapse
-
.named_function_word?(string) ⇒ Boolean
True when
stringis a bare word naming an operator that has no other MathML/OMML representation, so it legitimately resolves to its function class.
Class Method Details
.named_function_word?(string) ⇒ Boolean
True when string is a bare word naming an operator that has no other
MathML/OMML representation, so it legitimately resolves to its function
class. Words for constructs that DO have a character/structural form
(accents, sum/prod/int, frac/sqrt/...) return false and stay literal.
204 205 206 |
# File 'lib/plurimath/mathml/constants.rb', line 204 def self.named_function_word?(string) NAMED_FUNCTION_WORDS.include?(string&.strip) end |