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", "ς": "beta", "σ": "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
- SYMBOLS =
{ "|": "|", "/": "//", "\\": "\\\\", "~": "tilde", "(": "(", ")": ")", "(:": "(:", ":)": ":)", "{": "{", "}": "}", "{:": "{:", ":}": ":}", "]": "]", "[": "[", "=": "=", "+": "+", "-": "-", }.freeze
- ACCENT_WORDS =
Over/under accent decorations. In MathML these are only ever expressed as <mover>/<munder> with a base (recovered from their diacritic CHARACTER), never as a bare <mi>/<mo> identifier word. So a bare token whose text is one of these names is a literal identifier (e.g. the unit “bar”), not the accent. See unitsml/unitsdb#123.
%w[ bar overline ul hat vec tilde dot ddot obrace ubrace overleftrightarrow ].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
- OPERATORS =
[ "    ", "  ", "*", "<", ">", " ", "¬", "±", "×", "÷", "Γ", "Δ", "Θ", "Λ", "Ξ", "Π", "Σ", "Ω", "…", "′", "ℂ", "ℕ", "ℚ", "ℝ", "ℤ", "ℵ", "←", "↑", "→", "→", "↓", "↔", "↠", "↣", "↦", "⇐", "⇒", "⇒", "⇔", "⇔", "∀", "∂", "∃", "∅", "∇", "∈", "∉", "∏", "∑", "−", "∓", "∝", "∞", "∠", "∧", "∨", "∩", "∪", "∫", "∮", "∴", "∵", "∼", "≅", "≈", "≔", "≠", "≡", "≤", "≥", "≪", "≫", "≺", "≻", "⊂", "⊃", "⊆", "⊇", "⊕", "⊗", "⊙", "⊢", "⊤", "⊥", "⊨", "⋀", "⋁", "⋂", "⋃", "⋄", "⋅", "⋆", "⋈", "⋉", "⋊", "⋮", "⋯", "⋱", "⌈", "⌉", "⌊", "⌋", "⌢", "□", "△", "⚬", "⤖", "⪯", "⪰", "+", "=", ":", "<", "×", "±", "&", ";", ">", "|", "lim", "max", "min", "\\", "//", "/", "if", "^", "_", "+", "/", "=", ":", ",", ")", "(", "[", "]", ].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
-
.accent_word?(string) ⇒ Boolean
True when
stringis a bare word naming an over/under accent.
Class Method Details
.accent_word?(string) ⇒ Boolean
True when string is a bare word naming an over/under accent. Such tokens are literal identifiers in MathML (the accent itself is a diacritic character inside <mover>/<munder>), so callers must not promote them to accent operators. AsciiMath/LaTeX word forms (bar(x), barx) are parsed elsewhere and never reach this predicate.
191 192 193 |
# File 'lib/plurimath/mathml/constants.rb', line 191 def self.accent_word?(string) ACCENT_WORDS.include?(string&.strip) end |