From b341e8482071ac9dae6893227bf8ee83ca7d0418 Mon Sep 17 00:00:00 2001 From: NSoiffer Date: Wed, 6 Mar 2024 07:38:41 +0000 Subject: [PATCH] Added full set of names based on unicode.xml Changed from emitting dots to using text based on feedback Renamed "EuroBraille" to "LaTeX" Still need to look through name list some more. --- PythonScripts/euro-braille-short.csv | 114 ++++ PythonScripts/euro-braille.py | 172 ++++-- Rules/Braille/EuroBraille/unicode.yaml | 374 -------------- .../LaTeX_Rules.yaml} | 181 +++---- .../{EuroBraille => LaTeX}/definitions.yaml | 0 Rules/Braille/LaTeX/unicode.yaml | 488 ++++++++++++++++++ Rules/prefs.yaml | 3 + src/braille.rs | 21 +- src/main.rs | 61 +-- tests/braille.rs | 2 +- .../{EuroBraille => LaTeX}/augenbit.rs | 71 +-- tests/common/mod.rs | 1 + 12 files changed, 899 insertions(+), 589 deletions(-) create mode 100644 PythonScripts/euro-braille-short.csv delete mode 100644 Rules/Braille/EuroBraille/unicode.yaml rename Rules/Braille/{EuroBraille/EuroBraille_Rules.yaml => LaTeX/LaTeX_Rules.yaml} (88%) rename Rules/Braille/{EuroBraille => LaTeX}/definitions.yaml (100%) create mode 100644 Rules/Braille/LaTeX/unicode.yaml rename tests/braille/{EuroBraille => LaTeX}/augenbit.rs (68%) diff --git a/PythonScripts/euro-braille-short.csv b/PythonScripts/euro-braille-short.csv new file mode 100644 index 00000000..3e4d43b7 --- /dev/null +++ b/PythonScripts/euro-braille-short.csv @@ -0,0 +1,114 @@ +<= \le kleiner gleich +<< \ll viel kleiner +>= \ge groesser gleich +>> \gg viel groesser +\8 \infty unendlich +\apx \approx etwa +\be \begin{equation} +\bea \begin{eqnarray} +\beas \begin{eqnarray*} +\bs \backslash Backslash +\cd \cdots mittige Dots +\da \downarrow einfacher Pfeil nach unten +\dd \ddots diagonale Dots +\Do \o kleines daenisches 'o' +\ee \end{equation} +\eea \end{eqnarray} +\eeas \end{eqnarray*} +\eqv \equiv aequivalent +\es \emptyset leere Menge +\ex \exists es existiert +\f \frac Bruch +\fa \forall fuer alle +\fmf Rahmen um einfache Formel +\fsf Rahmen um mehrzeilige Formel +\inn \int\nolimits Integral nolimits +\inl \int\limits Integral limits +\l< \langle Winkelklammer links +\la \leftarrow einfacher Pfeil nach links +\ld \ldots line Dots +\lgla \longleftarrow langer Pfeil nach links +\lglra \longleftrightarrow langer Pfeil nach links und rechts +\lgmt \longmapsto langer folgt-aus-Pfeil +\lgra \longrightarrow langer Pfeil nach rechts +\lra \leftrightarrow einfacher Pfeil nach links und rechts +\Lra \leftrightarrow doppelter Pfeil nach links und rechts +\lt \leadsto fuehrt-zu-Pfeil +\mt \mapsto folgt-aus-Pfeil +\n \not Negation +\o+ \oplus +\o- \ominus +\o. \opoint +\o/ \oslash +\oin \oint\nolimits Kreisintegral nolimits +\oil \oint\limits Kreisintegral limits +\ol \overline Ueberstrich +\ox \otimes +\pn \prod\nolimits Produkt nolimits +\pl \prod\limits Produkt limits +\Pl \l kleines polnisches 'l' +\pll \parallel parallel +\r> \rangle Winkelklammer rechts +\ra \rightarrow einfacher Pfeil nach rechts +\Ra \rightarrow doppelter Pfeil nach rechts +\s \sqrt Wurzel +\sbs \subset Untermenge +\sbse \subseteq Untermenge und gleich +\sps \supset Obermenge +\spse \supseteq Obermenge und gleich +\sun \sum\nolimits Summe nolimits +\sul \sum\limits Summe limits +\tri \triangle Dreieck +\ua \uparrow einfacher Pfeil nach unten +\uda \updownarrow einfacher Pfeil nach unten und oben +\ul \underline Unterstrich +\vd \vdots vertikale Dots +\x \times +~a \alpha +~b \beta +~g \gamma +~d \delta +~e \epsilon +~z \zeta +~j \eta +~h \theta +~i \iota +~k \kappa +~l \lambda +~m \mu +~n \nu +~x \xi +~o \o +~p \pi +~r \rho +~s \sigma +~t \tau +~u \upsilon +~f \phi +~c \chi +~y \psi +~w \omega +~A \Alpha +~B \Beta +~G \Gamma +~D \Delta +~E \Epsilon +~Z \Zeta +~J \Eta +~H \Theta +~I \Iota +~K \Kappa +~L \Lambda +~M \Mu +~N \Nu +~X \Xi +~O \O +~P \Pi +~R \Rho +~S \Sigma +~T \Tau +~U \Upsilon +~F \Phi +~C \Chi +~Y \Psi +~W \Omega diff --git a/PythonScripts/euro-braille.py b/PythonScripts/euro-braille.py index 23d30d62..c73497f8 100644 --- a/PythonScripts/euro-braille.py +++ b/PythonScripts/euro-braille.py @@ -3,6 +3,7 @@ from html_table_extractor.extractor import Extractor from typing import TextIO import sys +from string import ascii_uppercase, ascii_lowercase import xml.etree.ElementTree as ET import re sys.stdout.reconfigure(encoding='utf-8') @@ -79,7 +80,28 @@ def get_unicode_yaml_chars() -> set[str]: UNICODE_CHARS_SHORT = get_unicode_yaml_chars() +def get_short_dict() -> dict[str, str]: + with open("euro-braille-short.csv", "r", encoding='utf8') as stream: + answer = {} + for line in stream.readlines(): + parts: list[str] = list(filter(lambda x: x != '', line.split(' '))) + short_name = parts[0].strip() + latex_name = parts[1].strip() + answer[latex_name] = short_name + for ch in ascii_lowercase + ascii_uppercase: + answer[f'\\mathbb{{{ch}}}'] = f'\\{ch}' + return answer + + def extract_latex(in_file): + short_names = get_short_dict() + overrides = { + "*": "*", "{": "\\{", "}": "\\}", "|": "|", + "°": "°", "ϵ": "\\epsilon", "≠": "\\not=", # varepsilon + "′": "'", "″": "''", "‴": "'''", + "△": "\\triangle", "→": "\\to", + } + tree = ET.parse(in_file) root = tree.getroot() all_chars = root.find("charlist") @@ -90,35 +112,69 @@ def extract_latex(in_file): full_stream.write("---\n") for char in all_chars: ch = convert_to_char(char.get("id")) - if len(ch) == 1 and ord(ch) < 128: + if len(ch) > 1: continue + code = ord(ch) + if code < 0x20: + continue + if ch in overrides: + latex_name = overrides[ch] + write_line(ch, latex_name, short_names.get(latex_name, ''), short_stream) + continue + + # add in ASCII and the Greek block + stream = short_stream if ch in UNICODE_CHARS_SHORT or code < 0x7F or (0x0370 <= code and code <= 0x03fF) else full_stream - stream = short_stream if ch in UNICODE_CHARS_SHORT else full_stream - latex = char.find("latex") - var_latex = char.find("varlatex") - ams_latex = char.find("ams") - math_latex = char.find("mathlatex") - # if latex is None and not(var_latex is None and math_latex is None): - # print(f"No latex for ch: {ch}/{char.get('id')}" + - # "" if var_latex is None else f"var_latex={var_latex.text}" + - # "" if math_latex is None else f"math_latex={math_latex.text}" - # ) - # continue - - names_seen = [] - for latex_name in [latex, var_latex, ams_latex, math_latex]: + # I wish there was a simple way to choose the names. + # Based on what David Carlisle (who maintains unicode.xml) recomends, + # 'math_latex' is the preferred field except for the alphabets (I only exclude Greek and math alphanumerics) + # For those, math_latex is more technically correct but not what most latex users are accustomed to + names_seen: list[str] = [] + for style in ["mathlatex", "latex", "varlatex", "ams"]: + latex_name = char.find(style) if latex_name is None: continue - latex_name = latex_name.text.strip() - if latex_name in names_seen: + latex_name:str = latex_name.text.strip() + # the fontencoding char won't happen and the \unicode (two ellipsis entries) have short names for the latex style + if latex_name.startswith('{\\fontencoding{') or latex_name.startswith('\\unicode'): continue - if latex_name.startswith('\\up') and "\\" + latex_name[3:] in names_seen: # "\upiota", etc, is skipped + if not latex_name.startswith('\\') and not latex_name.startswith('{') and code >= 0x7F: + latex_name = '\\' + latex_name # some are missing the initial \ + if latex_name.startswith('\\mathchar'): + continue # seems to happen once -- not sure what that is about + if style == 'mathlatex': + if code < 0x7F: + continue # use the latex names + if 0x0370 <= code and code <= 0x03fF: + continue # Greek block + if 0x1D400 <= code and code <= 0x1D7FF: + continue # alphanumerics + if latex_name.startswith('\\Bbb'): # some blackboard chars (ℝ, etc) not in math alphanumerics + continue + if latex_name.startswith('\\mbox'): + continue # the alternative name avoids that and so is better + if latex_name.lower().find('theta') != -1: + latex_name = latex_name.replace("text", "") # don't care about upright theta + elif ch == '$': + latex_name = '\\$' + elif ch == '\\': + latex_name = '\\backslash' # avoid '\textbackslash' + elif latex_name.startswith("\\mitBbb"): + latex_name = latex_name.replace("\\mitBbb", "") # exponential e, etc + if latex_name in names_seen: continue if len(names_seen) > 0: stream.write('# ') # alternative name - write_line(ch, latex_name, stream) + write_line(ch, latex_name, short_names.get(latex_name, ''), stream) names_seen.append(latex_name) + # write the invisible chars out + short_stream.write('\n # invisible chars\n') + write_line(chr(0x2061), '', '', short_stream) + write_line(chr(0x2062), '', '', short_stream) + write_line(chr(0x2063), '', '', short_stream) + write_line(chr(0x2064), '', '', short_stream) + def convert_to_char(str: str) -> str: # str is 'Uddddd' or 'Uddddd-ddddd' @@ -127,29 +183,14 @@ def convert_to_char(str: str) -> str: for char_str in str.split("-"): # FIX: need to add backslash is str becomes "" ch = chr(int(char_str, base=16)) - if (ch == '"' or ch == '\\'): - answer += "\\" + # if (ch == '"' or ch == '\\'): + # answer += "\\" answer += ch return answer -def create_greek_letters(out_file: str): - # the HTML file has rowspans in it -- hence the use of table extractor - with open("greek-letters.txt", encoding='utf8') as in_stream: - with open(out_file, 'w', encoding='utf8') as out_stream: - all_entries = [] - lines = in_stream.readlines() - for line in lines: - parts = line.split('\t') - if parts[1].startswith('\\'): # ignore 'A', etc., which don't have latex commands - all_entries.append((parts[0].strip(), parts[1].strip())) - all_entries = sorted(all_entries) - for unicode, latex in all_entries: - write_line(unicode, latex, out_stream) - - -def write_line(ch: str, latex: str, out_stream: TextIO): +def write_line(ch: str, latex: str, short: str, out_stream: TextIO): def hex_string(ch: str) -> str: comment = '' if ch == '\\\\' or ch == '\\"': @@ -160,21 +201,70 @@ def hex_string(ch: str) -> str: comment = "0" + ch[1:] return comment + if ord(ch) < 0x7F and len(latex) <= 1: + return # probably an ASCII char + if ch == '"': ch = '\\"' elif ch == '\\': ch = '\\\\' elif ch == '\\127': ch = '\\x7F' - space = '' if ch.startswith('\\') and not(ch.endswith('}')) else ' ' - braille = ascii_to_euro_braille(latex + space) - first_part = f' - "{ch}": [t: "{braille}"]' + elif ch == "°": + latex = "°" # special case in their code + short_space = '𝐖' if short.startswith('\\') and not short.endswith('}') and len(short) > 2 else '' + long_space = '𝐖' if latex.startswith('\\') and not latex.endswith('}') and len(latex) > 2 else '' try: - out_stream.write('{:40}# {} ({})\n'.format(first_part, hex_string(ch), latex)) + # write untranslated text + latex = latex.replace('\\', '\\\\').replace('"', '\\"') + short = short.replace('\\', '\\\\').replace('"', '\\"') + if short == '': + first_part_char = f' - "{ch}": [t: "{latex + long_space}"]' + out_stream.write(f'{first_part_char:<40} # {hex_string(ch)}\n') + else: + first_part_char = f' - "{ch}":' + first_part_short = f' then: [t: "{short + short_space}"]' + first_part_long = f' else: [t: "{latex + long_space}"]' + out_stream.write(f'{first_part_char:<40} # {hex_string(ch)}\n') + out_stream.write(' - test:\n') + out_stream.write(' if: "$LaTeX_UseShortName"\n') + out_stream.write(f'{first_part_short}\n') + out_stream.write(f'{first_part_long}\n') # not sure why, but this gives better alignment + # write the translated dots + # braille = ascii_to_euro_braille(latex + space) + # if short == '': + # first_part_char = f' - "{ch}": [t: "{braille}"]' + # out_stream.write(f'{first_part_char:<40} # {hex_string(ch)} ({latex})\n') + # else: + # short_braille = ascii_to_euro_braille(short+space) # fix spacing + # first_part_char = f' - "{ch}":' + # first_part_short = f' else: [t: "{short_braille}"]' + # first_part_long = f' then: [t: "{braille}"]' + # out_stream.write(f'{first_part_char:<40} # {hex_string(ch)}\n') + # out_stream.write(' - test:\n') + # out_stream.write(' if: "$LaTeX_UseShortName=\'True\'"\n') + # out_stream.write(f'{first_part_long:<34} # {latex}\n') # not sure why, but this gives better alignment + # out_stream.write(f'{first_part_short:<36} # {short}\n') except: print(f"failed to write a line for ch='{ch}/{hex_string(ch)}'") +def create_greek_letters(out_file: str): + # the HTML file has rowspans in it -- hence the use of table extractor + with open("greek-letters.txt", encoding='utf8') as in_stream: + with open(out_file, 'w', encoding='utf8') as out_stream: + all_entries = [] + lines = in_stream.readlines() + for line in lines: + parts = line.split('\t') + if parts[1].startswith('\\'): # ignore 'A', etc., which don't have latex commands + all_entries.append((parts[0].strip(), parts[1].strip())) + all_entries = sorted(all_entries) + for unicode, latex in all_entries: + write_line(unicode, latex, out_stream) + + + # create_unicode_from_list_of_symbols_html("euro-symbols2.yaml") # create_greek_letters("greek-letters.yaml") diff --git a/Rules/Braille/EuroBraille/unicode.yaml b/Rules/Braille/EuroBraille/unicode.yaml deleted file mode 100644 index 8d42a5e9..00000000 --- a/Rules/Braille/EuroBraille/unicode.yaml +++ /dev/null @@ -1,374 +0,0 @@ ---- -# ASCII chars from JAWS 8-dot table - - "0": [t: "⠬"] # 0x30 - - "1": [t: "⠡"] # 0x31 - - "2": [t: "⠣"] # 0x32 - - "3": [t: "⠩"] # 0x33 - - "4": [t: "⠹"] # 0x34 - - "5": [t: "⠱"] # 0x35 - - "6": [t: "⠫"] # 0x36 - - "7": [t: "⠻"] # 0x37 - - "8": [t: "⠳"] # 0x38 - - "9": [t: "⠪"] # 0x39 - - " ": [t: "⠀"] # 0x20 - - "!": [t: "⠐"] # 0x21 - - "\"": [t: "⠈"] # 0x22 - - "#": [t: "⠼"] # 0x23 - - "$": [t: "⠨"] # 0x24 - - "%": [t: "⠿"] # 0x25 - - "&": [t: "⠯"] # 0x26 - - "'": [t: "⠠"] # 0x27 - - "(": [t: "⠦"] # 0x28 - - ")": [t: "⠴"] # 0x29 - - "*": [t: "⠔"] # 0x2a - - "+": [t: "⠖"] # 0x2b - - ",": [t: "⠂"] # 0x2c - - "-": [t: "⠤"] # 0x2d - - ".": [t: "⠄"] # 0x2e - - "/": [t: "⠲"] # 0x2f - - ":": [t: "⠒"] # 0x3a - - ";": [t: "⠆"] # 0x3b - - "<": [t: "⠰"] # 0x3c - - "=": [t: "⠶"] # 0x3d - - ">": [t: "⠘"] # 0x3e - - "?": [t: "⠢"] # 0x3f - - "@": [t: "⡜"] # 0x40 - - "A": [t: "⡁"] # 0x41 - - "B": [t: "⡃"] # 0x42 - - "C": [t: "⡉"] # 0x43 - - "D": [t: "⡙"] # 0x44 - - "E": [t: "⡑"] # 0x45 - - "F": [t: "⡋"] # 0x46 - - "G": [t: "⡛"] # 0x47 - - "H": [t: "⡓"] # 0x48 - - "I": [t: "⡊"] # 0x49 - - "J": [t: "⡚"] # 0x4a - - "K": [t: "⡅"] # 0x4b - - "L": [t: "⡇"] # 0x4c - - "M": [t: "⡍"] # 0x4d - - "N": [t: "⡝"] # 0x4e - - "O": [t: "⡕"] # 0x4f - - "P": [t: "⡏"] # 0x50 - - "Q": [t: "⡟"] # 0x51 - - "R": [t: "⡗"] # 0x52 - - "S": [t: "⡎"] # 0x53 - - "T": [t: "⡞"] # 0x54 - - "U": [t: "⡥"] # 0x55 - - "V": [t: "⡧"] # 0x56 - - "W": [t: "⡺"] # 0x57 - - "X": [t: "⡭"] # 0x58 - - "Y": [t: "⡽"] # 0x59 - - "Z": [t: "⡵"] # 0x5a - - "[": [t: "⡷"] # 0x5b - - "\\": [t: "⡌"] # 0x5c - - "]": [t: "⡾"] # 0x5d - - "^": [t: "⡮"] # 0x5e - - "_": [t: "⡸"] # 0x5f - - "`": [t: "⠜"] # 0x60 - - "a": [t: "⠁"] # 0x61 - - "b": [t: "⠃"] # 0x62 - - "c": [t: "⠉"] # 0x63 - - "d": [t: "⠙"] # 0x64 - - "e": [t: "⠑"] # 0x65 - - "f": [t: "⠋"] # 0x66 - - "g": [t: "⠛"] # 0x67 - - "h": [t: "⠓"] # 0x68 - - "i": [t: "⠊"] # 0x69 - - "j": [t: "⠚"] # 0x6a - - "k": [t: "⠅"] # 0x6b - - "l": [t: "⠇"] # 0x6c - - "m": [t: "⠍"] # 0x6d - - "n": [t: "⠝"] # 0x6e - - "o": [t: "⠕"] # 0x6f - - "p": [t: "⠏"] # 0x70 - - "q": [t: "⠟"] # 0x71 - - "r": [t: "⠗"] # 0x72 - - "s": [t: "⠎"] # 0x73 - - "t": [t: "⠞"] # 0x74 - - "u": [t: "⠥"] # 0x75 - - "v": [t: "⠧"] # 0x76 - - "w": [t: "⠺"] # 0x77 - - "x": [t: "⠭"] # 0x78 - - "y": [t: "⠽"] # 0x79 - - "z": [t: "⠵"] # 0x7a - - "{": [t: "⠷"] # 0x7b - - "|": [t: "⠌"] # 0x7c - - "}": [t: "⠾"] # 0x7d - - "~": [t: "⠮"] # 0x7e - - "\x7F": [t: "⠸"] # 0x7F - - -# Manually added - - "⁡": [t: ""] # 0x2061⁡ (invisible function apply) - - "⁢": [t: ""] # 0x2062 (invisible times) - - "⁣": [t: ""] # 0x2063⁡ (invisible separator) - - "⁤": [t: ""] # 0x2064 (invisible plus) - - - "′": [t: "⠠"] # 0x2032 (prime -- normally \prime, but ASCII "'" is used) - - "″": [t: "⠠⠠"] # 0x2033 (Double prime sign) - - "‴": [t: "⠠⠠⠠"] # 0x2034 (Triple prime sign) - - - "Γ": [t: "⡌⡛⠁⠍⠍⠁⠀"] # 0x393 (\Gamma) - - "Δ": [t: "⡌⡙⠑⠇⠞⠁⠀"] # 0x394 (\Delta) - - "Ζ": [t: "⡌⡵⠑⠞⠁⠀"] # 0x396 (\Zeta) - - "Η": [t: "⡌⡑⠞⠁⠀"] # 0x397 (\Eta) - - "Θ": [t: "⡌⡞⠓⠑⠞⠁⠀"] # 0x398 (\Theta) - - "Ι": [t: "⡌⡊⠕⠞⠁⠀"] # 0x399 (\Iota) - - "Κ": [t: "⡌⡅⠁⠏⠏⠁⠀"] # 0x39a (\Kappa) - - "Λ": [t: "⡌⡇⠁⠍⠃⠙⠁⠀"] # 0x39b (\Lambda) - - "Μ": [t: "⡌⡍⠥⠀"] # 0x39c (\Mu) - - "Ν": [t: "⡌⡝⠥⠀"] # 0x39d (\Nu) - - "Ξ": [t: "⡌⡭⠊⠀"] # 0x39e (\Xi) - - "Π": [t: "⡌⡏⠊⠀"] # 0x3a0 (\Pi) - - "Ρ": [t: "⡌⡗⠓⠕⠀"] # 0x3a1 (\Rho) - - "Σ": [t: "⡌⡎⠊⠛⠍⠁⠀"] # 0x3a3 (\Sigma) - - "Τ": [t: "⡌⡞⠁⠥⠀"] # 0x3a4 (\Tau) - - "Υ": [t: "⡌⡥⠏⠎⠊⠇⠕⠝⠀"] # 0x3a5 (\Upsilon) - - "Φ": [t: "⡌⡏⠓⠊⠀"] # 0x3a6 (\Phi) - - "Χ": [t: "⡌⡉⠓⠊⠀"] # 0x3a7 (\Chi) - - "Ψ": [t: "⡌⡏⠎⠊⠀"] # 0x3a8 (\Psi) - - "Ω": [t: "⡌⡕⠍⠑⠛⠁⠀"] # 0x3a9 (\Omega) - - "α": [t: "⡌⠁⠇⠏⠓⠁⠀"] # 0x3b1 (\alpha) - - "β": [t: "⡌⠃⠑⠞⠁⠀"] # 0x3b2 (\beta) - - "γ": [t: "⡌⠛⠁⠍⠍⠁⠀"] # 0x3b3 (\gamma) - - "δ": [t: "⡌⠙⠑⠇⠞⠁⠀"] # 0x3b4 (\delta) - - "ε": [t: "⡌⠧⠁⠗⠑⠏⠎⠊⠇⠕⠝⠀"] # 0x3b5 (\varepsilon) - - "ζ": [t: "⡌⠵⠑⠞⠁⠀"] # 0x3b6 (\zeta) - - "η": [t: "⡌⠑⠞⠁⠀"] # 0x3b7 (\eta) - - "θ": [t: "⡌⠞⠓⠑⠞⠁⠀"] # 0x3b8 (\theta) - - "ι": [t: "⡌⠊⠕⠞⠁⠀"] # 0x3b9 (\iota) - - "κ": [t: "⡌⠅⠁⠏⠏⠁⠀"] # 0x3ba (\kappa) - - "λ": [t: "⡌⠇⠁⠍⠃⠙⠁⠀"] # 0x3bb (\lambda) - - "μ": [t: "⡌⠍⠥⠀"] # 0x3bc (\mu) - - "ν": [t: "⡌⠝⠥⠀"] # 0x3bd (\nu) - - "ξ": [t: "⡌⠭⠊⠀"] # 0x3be (\xi) - - "π": [t: "⡌⠏⠊⠀"] # 0x3c0 (\pi) - - "ρ": [t: "⡌⠗⠓⠕⠀"] # 0x3c1 (\rho) - - "ς": [t: "⡌⠧⠁⠗⠎⠊⠛⠍⠁⠀"] # 0x3c2 (\varsigma) - - "σ": [t: "⡌⠎⠊⠛⠍⠁⠀"] # 0x3c3 (\sigma) - - "τ": [t: "⡌⠞⠁⠥⠀"] # 0x3c4 (\tau) - - "υ": [t: "⡌⠥⠏⠎⠊⠇⠕⠝⠀"] # 0x3c5 (\upsilon) - - "φ": [t: "⡌⠏⠓⠊⠀"] # 0x3c6 (\phi) - - "𝜑": [t: "⡌⠧⠁⠗⠏⠓⠊⠀"] # 0x3c6 (\varphi) - - "χ": [t: "⡌⠉⠓⠊⠀"] # 0x3c7 (\chi) - - "ψ": [t: "⡌⠏⠎⠊⠀"] # 0x3c8 (\psi) - - "ω": [t: "⡌⠕⠍⠑⠛⠁⠀"] # 0x3c9 (\omega) - - "ϑ": [t: "⡌⠧⠁⠗⠞⠓⠑⠞⠁⠀"] # 0x3d1 (\vartheta) - - "ϱ": [t: "⡌⠧⠁⠗⠗⠓⠕⠀"] # 0x3f1 (\varrho) - - "ϵ": [t: "⡌⠑⠏⠎⠊⠇⠕⠝⠀"] # 0x3f5 (\epsilon) - -# these seem to use the 8 dot braille encodings - - "°": [t: "⢸"] # 0xb0 - -# from en.wikipedia.org/wiki/List_of_mathematical_symbols_by_subject - - "¬": [t: "⡌⠇⠝⠕⠞⠀"] # 0xac (\lnot) - - "±": [t: "⡌⠏⠍⠀"] # 0xb1 (\pm) - - "×": [t: "⡌⠞⠊⠍⠑⠎⠀"] # 0xd7 (\times) - - "÷": [t: "⡌⠙⠊⠧⠀"] # 0xf7 (\div) - - "˚": [t: "⡌⠉⠊⠗⠉⠀"] # 0x2da (\circ) - - "̅": [t: "⡌⠕⠧⠑⠗⠇⠊⠝⠑⠀"] # 0x305 (\overline) - - "̲": [t: "⡌⠥⠝⠙⠑⠗⠇⠊⠝⠑⠀"] # 0x332 (\underline) -# - "‖": [t: "⡌⡧⠑⠗⠞⠀"] # 0x2016 (\Vert) - - "‖": [t: "⡌⠌⠀"] # 0x2016 (\|) - - "•": [t: "⡌⠃⠥⠇⠇⠑⠞⠀"] # 0x2022 (\bullet) - - "⁻": [t: "⡌⠃⠁⠗⠷⡗⠾⠀"] # 0x207b (\bar R) - - "⃗": [t: "⡌⠧⠑⠉⠀"] # 0x20d7 (\vec) - - "ℂ": [t: "⡌⠍⠁⠞⠓⠃⠃⠀⡉⠀"] # 0x2102 (\mathbb C) - - "ℍ": [t: "⡌⠍⠁⠞⠓⠃⠃⠀⡓⠀"] # 0x210d (\mathbb H) - - "ℑ": [t: "⡌⡊⠍⠀"] # 0x2111 (\Im) - - "ℒ": [t: "⡌⠍⠁⠞⠓⠉⠁⠇⠀⡇⠀"] # 0x2112 (\mathcal L) - - "ℕ": [t: "⡌⠍⠁⠞⠓⠃⠃⠀⡝⠀"] # 0x2115 (\mathbb N) - - "℘": [t: "⡌⠺⠏⠀"] # 0x2118 (\wp) - - "ℚ": [t: "⡌⠍⠁⠞⠓⠃⠃⠀⡟⠀"] # 0x211a (\mathbb Q) - - "ℜ": [t: "⡌⡗⠑⠀"] # 0x211c (\Re) - - "ℝ": [t: "⡌⠍⠁⠞⠓⠃⠃⠀⡗⠀"] # 0x211d (\mathbb R) - - "ℤ": [t: "⡌⠍⠁⠞⠓⠃⠃⠀⡵⠀"] # 0x2124 (\mathbb Z) - - "ℵ": [t: "⡌⠁⠇⠑⠏⠓⠀"] # 0x2135 (\aleph) - - "ℶ": [t: "⡌⠃⠑⠞⠓⠀"] # 0x2136 (\beth) - - "⅋": [t: "⡌⠥⠏⠁⠝⠙⠀⠦⡝⠕⠀⡺⠊⠅⠊⠏⠑⠙⠊⠁⠀⠎⠥⠏⠏⠕⠗⠞⠴⠀"] # 0x214b (\upand (No Wikipedia support)) - - "←": [t: "⡌⠇⠑⠋⠞⠁⠗⠗⠕⠺⠀"] # 0x2190 (\leftarrow) - - "↑": [t: "⡌⠥⠏⠁⠗⠗⠕⠺⠀"] # 0x2191 (\uparrow) -# - "→": [t: "⡌⠗⠊⠛⠓⠞⠁⠗⠗⠕⠺⠀"] # 0x2192 (\rightarrow) - - "→": [t: "⡌⠞⠕⠀"] # 0x2192 (\to) - - "↓": [t: "⡌⠙⠕⠺⠝⠁⠗⠗⠕⠺⠀"] # 0x2193 (\downarrow) - - "↔": [t: "⡌⠇⠑⠋⠞⠗⠊⠛⠓⠞⠁⠗⠗⠕⠺⠀"] # 0x2194 (\leftrightarrow) - - "↖": [t: "⡌⠝⠺⠁⠗⠗⠕⠺⠀"] # 0x2196 (\nwarrow) - - "↗": [t: "⡌⠝⠑⠁⠗⠗⠕⠺⠀"] # 0x2197 (\nearrow) - - "↘": [t: "⡌⠎⠑⠁⠗⠗⠕⠺⠀"] # 0x2198 (\searrow) - - "↙": [t: "⡌⠎⠺⠁⠗⠗⠕⠺⠀"] # 0x2199 (\swarrow) - - "↠": [t: "⡌⠞⠺⠕⠓⠑⠁⠙⠗⠊⠛⠓⠞⠁⠗⠗⠕⠺⠀"] # 0x21a0 (\twoheadrightarrow) - - "↦": [t: "⡌⠍⠁⠏⠎⠞⠕⠀"] # 0x21a6 (\mapsto) - - "↪": [t: "⡌⠓⠕⠕⠅⠗⠊⠛⠓⠞⠁⠗⠗⠕⠺⠀"] # 0x21aa (\hookrightarrow) - - "⇒": [t: "⡌⡗⠊⠛⠓⠞⠁⠗⠗⠕⠺⠀"] # 0x21d2 (\Rightarrow) - - "⇔": [t: "⡌⡇⠑⠋⠞⠗⠊⠛⠓⠞⠁⠗⠗⠕⠺⠀"] # 0x21d4 (\Leftrightarrow) - - "∀": [t: "⡌⠋⠕⠗⠁⠇⠇⠀"] # 0x2200 (\forall) - - "∂": [t: "⡌⠏⠁⠗⠞⠊⠁⠇⠀"] # 0x2202 (\partial) - - "∃": [t: "⡌⠑⠭⠊⠎⠞⠎⠀"] # 0x2203 (\exists) - - "∄": [t: "⡌⠝⠑⠭⠊⠎⠞⠎⠀"] # 0x2204 (\nexists) - - "∅": [t: "⡌⠧⠁⠗⠝⠕⠞⠓⠊⠝⠛⠀"] # 0x2205 (\varnothing) - - "∆": [t: "⡌⡙⠑⠇⠞⠁⠀"] # 0x2206 (\Delta) -# - "∆": [t: "⡌⠞⠗⠊⠁⠝⠛⠇⠑⠀"] # 0x2206 (\triangle) - - "∇": [t: "⡌⠝⠁⠃⠇⠁⠀"] # 0x2207 (\nabla) - - "∈": [t: "⡌⠊⠝⠀"] # 0x2208 (\in) - - "∉": [t: "⡌⠝⠕⠞⠊⠝⠀"] # 0x2209 (\notin) - - "∋": [t: "⡌⠝⠊⠀"] # 0x220b (\ni) - - "∌": [t: "⡌⠝⠕⠞⡌⠝⠊⠀"] # 0x220c (\not\ni) - - "∏": [t: "⡌⠏⠗⠕⠙⠀"] # 0x220f (\prod) - - "∐": [t: "⡌⠉⠕⠏⠗⠕⠙⠀"] # 0x2210 (\coprod) - - "∑": [t: "⡌⠎⠥⠍⠀"] # 0x2211 (\sum) - - "∓": [t: "⡌⠍⠏⠀"] # 0x2213 (\mp) - - "∖": [t: "⡌⠎⠑⠞⠍⠊⠝⠥⠎⠀"] # 0x2216 (\setminus) -# - "∖": [t: "⡌⠎⠍⠁⠇⠇⠎⠑⠞⠍⠊⠝⠥⠎⠀"] # 0x2216 (\smallsetminus) - - "∗": [t: "⡌⠁⠎⠞⠀"] # 0x2217 (\ast) - - "∘": [t: "⡌⠉⠊⠗⠉⠀"] # 0x2218 (\circ) - - "√": [t: "⡌⠎⠟⠗⠞⠷⠾⠀"] # 0x221a (\sqrt{}) - - "∛": [t: "⡌⠎⠟⠗⠞⡷⠩⡾⠷⠭⠾⠀"] # 0x221b (\sqrt[3] x) - - "∜": [t: "⡌⠎⠟⠗⠞⡷⠹⡾⠷⠭⠾⠀"] # 0x221c (\sqrt[4] x) - - "∝": [t: "⡌⠏⠗⠕⠏⠞⠕⠀"] # 0x221d (\propto) - - "∞": [t: "⡌⠊⠝⠋⠞⠽⠀"] # 0x221e (\infty) - - "∠": [t: "⡌⠁⠝⠛⠇⠑⠀"] # 0x2220 (\angle) - - "∣": [t: "⡌⠍⠊⠙⠀"] # 0x2223 (\mid) - - "∤": [t: "⡌⠝⠍⠊⠙⠀"] # 0x2224 (\nmid) - - "∥": [t: "⡌⠏⠁⠗⠁⠇⠇⠑⠇⠀"] # 0x2225 (\parallel) - - "∦": [t: "⡌⠝⠏⠁⠗⠁⠇⠇⠑⠇⠀"] # 0x2226 (\nparallel) -# - "∧": [t: "⡌⠇⠁⠝⠙⠀"] # 0x2227 (\land) - - "∧": [t: "⡌⠺⠑⠙⠛⠑⠀"] # 0x2227 (\wedge) -# - "∨": [t: "⡌⠇⠕⠗⠀"] # 0x2228 (\lor) - - "∨": [t: "⡌⠧⠑⠑⠀"] # 0x2228 (\vee) - - "∩": [t: "⡌⠉⠁⠏⠀"] # 0x2229 (\cap) - - "∪": [t: "⡌⠉⠥⠏⠀"] # 0x222a (\cup) - - "∫": [t: "⡌⠊⠝⠞⠀"] # 0x222b (\int) - - "∬": [t: "⡌⠊⠊⠝⠞⠀"] # 0x222c (\iint) - - "∭": [t: "⡌⠊⠊⠊⠝⠞⠀"] # 0x222d (\iiint) - - "∮": [t: "⡌⠕⠊⠝⠞⠀"] # 0x222e (\oint) - - "∯": [t: "⡌⠕⠊⠊⠝⠞⠀"] # 0x222f (\oiint) - - "∰": [t: "⡌⠕⠊⠊⠊⠝⠞⠀"] # 0x2230 (\oiiint) - - "∴": [t: "⡌⠞⠓⠑⠗⠑⠋⠕⠗⠑⠀"] # 0x2234 (\therefore) - - "∵": [t: "⡌⠃⠑⠉⠁⠥⠎⠑⠀"] # 0x2235 (\because) - - "∼": [t: "⡌⠎⠊⠍⠀"] # 0x223c (\sim) - - "∽": [t: "⡌⠃⠁⠉⠅⠎⠊⠍⠀"] # 0x223d (\backsim) - - "≀": [t: "⡌⠺⠗⠀"] # 0x2240 (\wr) - - "≁": [t: "⡌⠝⠕⠞⡌⠎⠊⠍⠀"] # 0x2241 (\not\sim) - - "≂": [t: "⡌⠑⠟⠎⠊⠍⠀"] # 0x2242 (\eqsim) - - "≃": [t: "⡌⠎⠊⠍⠑⠟⠀"] # 0x2243 (\simeq) - - "≅": [t: "⡌⠉⠕⠝⠛⠀"] # 0x2245 (\cong) - - "≇": [t: "⡌⠝⠕⠞⡌⠉⠕⠝⠛⠀"] # 0x2247 (\not\cong) - - "≈": [t: "⡌⠁⠏⠏⠗⠕⠭⠀"] # 0x2248 (\approx) - - "≐": [t: "⡌⠙⠕⠞⠑⠟⠀"] # 0x2250 (\doteq) - - "≙": [t: "⡌⠺⠊⠙⠑⠓⠁⠞⠷⠶⠾⠀"] # 0x2259 (\widehat =) - - "≜": [t: "⡌⠞⠗⠊⠁⠝⠛⠇⠑⠟⠀"] # 0x225c (\triangleq) - - "≝": [t: "⡌⠕⠧⠑⠗⠎⠑⠞⠷⡌⠕⠏⠑⠗⠁⠞⠕⠗⠝⠁⠍⠑⠷⠙⠑⠋⠾⠾⠷⠶⠾⠀"] # 0x225d (\overset{\operatorname{def}} =) - - "≟": [t: "⡌⠕⠧⠑⠗⠎⠑⠞⠷⠢⠾⠷⠶⠾⠀"] # 0x225f (\overset ? =) - - "≠": [t: "⡌⠝⠕⠞⠶⠀"] # 0x2260 (\not=) - - "≡": [t: "⡌⠑⠟⠥⠊⠧⠀"] # 0x2261 (\equiv) -# - "≤": [t: "⡌⠇⠑⠀"] # 0x2264 (\le) - - "≤": [t: "⡌⠇⠑⠟⠀"] # 0x2264 (\leq) -# - "≥": [t: "⡌⠛⠑⠀"] # 0x2265 (\ge) - - "≥": [t: "⡌⠛⠑⠟⠀"] # 0x2265 (\geq) - - "≦": [t: "⡌⠇⠑⠟⠟⠀"] # 0x2266 (\leqq) - - "≧": [t: "⡌⠛⠑⠟⠟⠀"] # 0x2267 (\geqq) - - "≪": [t: "⡌⠇⠇⠀"] # 0x226a (\ll) - - "≫": [t: "⡌⠛⠛⠀"] # 0x226b (\gg) - - "≮": [t: "⡌⠝⠇⠑⠎⠎⠀"] # 0x226e (\nless) - - "≯": [t: "⡌⠝⠛⠞⠗⠀"] # 0x226f (\ngtr) - - "≰": [t: "⡌⠝⠕⠞⡌⠇⠑⠟⠀"] # 0x2270 (\not\leq) - - "≱": [t: "⡌⠝⠕⠞⡌⠛⠑⠟⠀"] # 0x2271 (\not\geq) - - "≲": [t: "⡌⠇⠑⠎⠎⠎⠊⠍⠀"] # 0x2272 (\lesssim) - - "≳": [t: "⡌⠛⠞⠗⠎⠊⠍⠀"] # 0x2273 (\gtrsim) - - "≴": [t: "⡌⠝⠕⠞⡌⠇⠑⠎⠎⠎⠊⠍⠀"] # 0x2274 (\not\lesssim) - - "≵": [t: "⡌⠝⠕⠞⡌⠛⠞⠗⠎⠊⠍⠀"] # 0x2275 (\not\gtrsim) - - "≶": [t: "⡌⠇⠑⠎⠎⠛⠞⠗⠀"] # 0x2276 (\lessgtr) - - "≷": [t: "⡌⠛⠞⠗⠇⠑⠎⠎⠀"] # 0x2277 (\gtrless) - - "≺": [t: "⡌⠏⠗⠑⠉⠀"] # 0x227a (\prec) - - "≻": [t: "⡌⠎⠥⠉⠉⠀"] # 0x227b (\succ) - - "≼": [t: "⡌⠏⠗⠑⠉⠉⠥⠗⠇⠽⠑⠟⠀"] # 0x227c (\preccurlyeq) - - "≽": [t: "⡌⠎⠥⠉⠉⠉⠥⠗⠇⠽⠑⠟⠀"] # 0x227d (\succcurlyeq) - - "≾": [t: "⡌⠏⠗⠑⠉⠎⠊⠍⠀"] # 0x227e (\precsim) - - "≿": [t: "⡌⠎⠥⠉⠉⠎⠊⠍⠀"] # 0x227f (\succsim) - - "⊂": [t: "⡌⠎⠥⠃⠎⠑⠞⠀"] # 0x2282 (\subset) - - "⊃": [t: "⡌⠎⠥⠏⠎⠑⠞⠀"] # 0x2283 (\supset) - - "⊄": [t: "⡌⠝⠕⠞⡌⠎⠥⠃⠎⠑⠞⠀"] # 0x2284 (\not\subset) - - "⊅": [t: "⡌⠝⠕⠞⡌⠎⠥⠏⠎⠑⠞⠀"] # 0x2285 (\not\supset) - - "⊆": [t: "⡌⠎⠥⠃⠎⠑⠞⠑⠟⠀"] # 0x2286 (\subseteq) - - "⊇": [t: "⡌⠎⠥⠏⠎⠑⠞⠑⠟⠀"] # 0x2287 (\supseteq) - - "⊈": [t: "⡌⠝⠕⠞⡌⠎⠥⠃⠎⠑⠞⠑⠟⠀"] # 0x2288 (\not\subseteq) - - "⊉": [t: "⡌⠝⠕⠞⡌⠎⠥⠏⠎⠑⠞⠑⠟⠀"] # 0x2289 (\not\supseteq) - - "⊊": [t: "⡌⠎⠥⠃⠎⠑⠞⠝⠑⠟⠀"] # 0x228a (\subsetneq) - - "⊋": [t: "⡌⠎⠥⠏⠎⠑⠞⠝⠑⠟⠀"] # 0x228b (\supsetneq) - - "⊍": [t: "⡌⠙⠕⠞⡌⠉⠥⠏⠀"] # 0x228d (\dot\cup) - - "⊎": [t: "⡌⠥⠏⠇⠥⠎⠀"] # 0x228e (\uplus) - - "⊏": [t: "⡌⠎⠟⠎⠥⠃⠎⠑⠞⠀"] # 0x228f (\sqsubset) - - "⊐": [t: "⡌⠎⠟⠎⠥⠏⠎⠑⠞⠀"] # 0x2290 (\sqsupset) - - "⊑": [t: "⡌⠎⠟⠎⠥⠃⠎⠑⠞⠑⠟⠀"] # 0x2291 (\sqsubseteq) - - "⊒": [t: "⡌⠎⠟⠎⠥⠏⠎⠑⠞⠑⠟⠀"] # 0x2292 (\sqsupseteq) - - "⊓": [t: "⡌⠎⠟⠉⠁⠏⠀"] # 0x2293 (\sqcap) - - "⊔": [t: "⡌⠎⠟⠉⠥⠏⠀"] # 0x2294 (\sqcup) - - "⊕": [t: "⡌⠕⠏⠇⠥⠎⠀"] # 0x2295 (\oplus) - - "⊖": [t: "⡌⠕⠍⠊⠝⠥⠎⠀"] # 0x2296 (\ominus) - - "⊗": [t: "⡌⠕⠞⠊⠍⠑⠎⠀"] # 0x2297 (\otimes) - - "⊘": [t: "⡌⠕⠎⠇⠁⠎⠓⠀"] # 0x2298 (\oslash) - - "⊢": [t: "⡌⠧⠙⠁⠎⠓⠀"] # 0x22a2 (\vdash) - - "⊤": [t: "⡌⠞⠕⠏⠀"] # 0x22a4 (\top) -# - "⊥": [t: "⡌⠃⠕⠞⠀"] # 0x22a5 (\bot) - - "⊥": [t: "⡌⠏⠑⠗⠏⠀"] # 0x22a5 (\perp) - - "⊨": [t: "⡌⠍⠕⠙⠑⠇⠎⠀"] # 0x22a8 (\models) - - "⊲": [t: "⡌⠧⠁⠗⠞⠗⠊⠁⠝⠛⠇⠑⠇⠑⠋⠞⠀"] # 0x22b2 (\vartriangleleft) - - "⊳": [t: "⡌⠧⠁⠗⠞⠗⠊⠁⠝⠛⠇⠑⠗⠊⠛⠓⠞⠀"] # 0x22b3 (\vartriangleright) - - "⊴": [t: "⡌⠞⠗⠊⠁⠝⠛⠇⠑⠇⠑⠋⠞⠑⠟⠀"] # 0x22b4 (\trianglelefteq) - - "⊵": [t: "⡌⠞⠗⠊⠁⠝⠛⠇⠑⠗⠊⠛⠓⠞⠑⠟⠀"] # 0x22b5 (\trianglerighteq) - - "⊸": [t: "⡌⠍⠥⠇⠞⠊⠍⠁⠏⠀"] # 0x22b8 (\multimap) - - "⊻": [t: "⡌⠧⠑⠑⠃⠁⠗⠀"] # 0x22bb (\veebar) - - "⋀": [t: "⡌⠃⠊⠛⠺⠑⠙⠛⠑⠀"] # 0x22c0 (\bigwedge) - - "⋁": [t: "⡌⠃⠊⠛⠧⠑⠑⠀"] # 0x22c1 (\bigvee) - - "⋂": [t: "⡌⠃⠊⠛⠉⠁⠏⠀"] # 0x22c2 (\bigcap) - - "⋃": [t: "⡌⠃⠊⠛⠉⠥⠏⠀"] # 0x22c3 (\bigcup) - - "⋅": [t: "⡌⠉⠙⠕⠞⠀"] # 0x22c5 (\cdot) - - "⋊": [t: "⡌⠗⠞⠊⠍⠑⠎⠀"] # 0x22ca (\rtimes) - - "⋚": [t: "⡌⠇⠑⠎⠎⠑⠟⠛⠞⠗⠀"] # 0x22da (\lesseqgtr) - - "⋛": [t: "⡌⠛⠞⠗⠑⠟⠇⠑⠎⠎⠀"] # 0x22db (\gtreqless) - - "⋞": [t: "⡌⠉⠥⠗⠇⠽⠑⠟⠏⠗⠑⠉⠀"] # 0x22de (\curlyeqprec) - - "⋟": [t: "⡌⠉⠥⠗⠇⠽⠑⠟⠎⠥⠉⠉⠀"] # 0x22df (\curlyeqsucc) - - "⋢": [t: "⡌⠝⠕⠞⡌⠎⠟⠎⠥⠃⠎⠑⠞⠑⠟⠀"] # 0x22e2 (\not\sqsubseteq) - - "⋣": [t: "⡌⠝⠕⠞⡌⠎⠟⠎⠥⠏⠎⠑⠞⠑⠟⠀"] # 0x22e3 (\not\sqsupseteq) - - "⋪": [t: "⡌⠝⠕⠞⡌⠧⠁⠗⠞⠗⠊⠁⠝⠛⠇⠑⠇⠑⠋⠞⠀"] # 0x22ea (\not\vartriangleleft) - - "⋫": [t: "⡌⠝⠕⠞⡌⠧⠁⠗⠞⠗⠊⠁⠝⠛⠇⠑⠗⠊⠛⠓⠞⠀"] # 0x22eb (\not\vartriangleright) - - "⋬": [t: "⡌⠝⠕⠞⡌⠞⠗⠊⠁⠝⠛⠇⠑⠇⠑⠋⠞⠑⠟⠀"] # 0x22ec (\not\trianglelefteq) - - "⋭": [t: "⡌⠝⠕⠞⡌⠞⠗⠊⠁⠝⠛⠇⠑⠗⠊⠛⠓⠞⠑⠟⠀"] # 0x22ed (\not\trianglerighteq) - - "⌟": [t: "⡌⠍⠁⠞⠓⠃⠊⠝⠷⡌⠇⠗⠉⠕⠗⠝⠑⠗⠾⠀"] # 0x231f (\mathbin{\lrcorner}) - - "■": [t: "⡌⠃⠇⠁⠉⠅⠎⠟⠥⠁⠗⠑⠀"] # 0x25a0 (\blacksquare) -# - "□": [t: "⡌⡃⠕⠭⠀"] # 0x25a1 (\Box) - - "□": [t: "⡌⠎⠟⠥⠁⠗⠑⠀"] # 0x25a1 (\square) - - "△": [t: "⡌⠞⠗⠊⠁⠝⠛⠇⠑⠀"] # 0x25b3 (\triangle) - - "⟂": [t: "⡌⠏⠑⠗⠏⠀"] # 0x27c2 (\perp) - - "⟃": [t: "⡌⠎⠥⠃⠎⠑⠞⠉⠊⠗⠉⠀"] # 0x27c3 (\subsetcirc) - - "⟄": [t: "⡌⠎⠥⠏⠎⠑⠞⠉⠊⠗⠉⠀"] # 0x27c4 (\supsetcirc) - - "⟵": [t: "⡌⠇⠕⠝⠛⠇⠑⠋⠞⠁⠗⠗⠕⠺⠀"] # 0x27f5 (\longleftarrow) - - "⟶": [t: "⡌⠇⠕⠝⠛⠗⠊⠛⠓⠞⠁⠗⠗⠕⠺⠀"] # 0x27f6 (\longrightarrow) -# - "⟹": [t: "⡌⡇⠕⠝⠛⠗⠊⠛⠓⠞⠁⠗⠗⠕⠺⠀"] # 0x27f9 (\Longrightarrow) - - "⟹": [t: "⡌⠊⠍⠏⠇⠊⠑⠎⠀"] # 0x27f9 (\implies) - - "⟺": [t: "⡌⠊⠋⠋⠀"] # 0x27fa (\iff) - - "⥲": [t: "⡌⠞⠊⠇⠙⠑⠷⡌⠗⠊⠛⠓⠞⠁⠗⠗⠕⠺⠾⠀"] # 0x2972 (\tilde{\rightarrow}) - - "⨯": [t: "⡌⠞⠊⠍⠑⠎⠀"] # 0x2a2f (\times) - - "⩀": [t: "⡌⠙⠕⠞⡌⠉⠁⠏⠀"] # 0x2a40 (\dot\cap) - - "⩄": [t: "⡌⠉⠁⠏⠺⠑⠙⠛⠑⠀"] # 0x2a44 (\capwedge) - - "⩒": [t: "⡌⠙⠕⠞⡌⠃⠊⠛⠧⠑⠑⠀"] # 0x2a52 (\dot\bigvee) -# - "⩒": [t: "⡌⠙⠕⠞⡌⠇⠕⠗⠀"] # 0x2a52 (\dot\lor) - - "⩽": [t: "⡌⠇⠑⠟⠎⠇⠁⠝⠞⠀"] # 0x2a7d (\leqslant) - - "⩾": [t: "⡌⠛⠑⠟⠎⠇⠁⠝⠞⠀"] # 0x2a7e (\geqslant) - - "⪅": [t: "⡌⠇⠑⠎⠎⠁⠏⠏⠗⠕⠭⠀"] # 0x2a85 (\lessapprox) - - "⪆": [t: "⡌⠛⠞⠗⠁⠏⠏⠗⠕⠭⠀"] # 0x2a86 (\gtrapprox) - - "⪋": [t: "⡌⠇⠑⠎⠎⠑⠟⠟⠛⠞⠗⠀"] # 0x2a8b (\lesseqqgtr) - - "⪌": [t: "⡌⠛⠞⠗⠑⠟⠟⠇⠑⠎⠎⠀"] # 0x2a8c (\gtreqqless) - - "⪯": [t: "⡌⠏⠗⠑⠉⠑⠟⠀"] # 0x2aaf (\preceq) - - "⪰": [t: "⡌⠎⠥⠉⠉⠑⠟⠀"] # 0x2ab0 (\succeq) - - "⫛": [t: "⡌⠍⠇⠉⠏⠀"] # 0x2adb (\mlcp) - - "𝒪": [t: "⡌⠍⠁⠞⠓⠉⠁⠇⠀⡕⠀"] # 0x1d4aa (\mathcal O) - - "𝒫": [t: "⡌⠍⠁⠞⠓⠉⠁⠇⠀⡏⠀"] # 0x1d4ab (\mathcal P) - - "𝔓": [t: "⡌⠍⠁⠞⠓⠋⠗⠁⠅⠀⡏⠀"] # 0x1d513 (\mathfrak P) - - "𝔠": [t: "⡌⠍⠁⠞⠓⠋⠗⠁⠅⠀⠉⠀"] # 0x1d520 (\mathfrak c) - - "𝔸": [t: "⡌⠍⠁⠞⠓⠃⠃⠀⡁⠀"] # 0x1d538 (\mathbb A) - - "𝔽": [t: "⡌⠍⠁⠞⠓⠃⠃⠀⡋⠀"] # 0x1d53d (\mathbb F) - - "𝕂": [t: "⡌⠍⠁⠞⠓⠃⠃⠀⡅⠀"] # 0x1d542 (\mathbb K) - - "𝕆": [t: "⡌⠍⠁⠞⠓⠃⠃⠀⡕⠀"] # 0x1d546 (\mathbb O) - - "𝕊": [t: "⡌⠍⠁⠞⠓⠃⠃⠀⡎⠀"] # 0x1d54a (\mathbb S) - - "𝜄": [t: "⡌⠊⠕⠞⠁⠀"] # 0x1d704 (\iota) diff --git a/Rules/Braille/EuroBraille/EuroBraille_Rules.yaml b/Rules/Braille/LaTeX/LaTeX_Rules.yaml similarity index 88% rename from Rules/Braille/EuroBraille/EuroBraille_Rules.yaml rename to Rules/Braille/LaTeX/LaTeX_Rules.yaml index ae1b83d5..3ca80329 100644 --- a/Rules/Braille/EuroBraille/EuroBraille_Rules.yaml +++ b/Rules/Braille/LaTeX/LaTeX_Rules.yaml @@ -14,7 +14,7 @@ - else_if: "@data-previous-space-width > 1.1" then: [t: "⠬"] - else_if: "@data-previous-space-width >= 0.25" # thickspace - then: [t: " "] + then: [t: "𝐖"] - x: "." - test: - if: "(@class='MathML-unit' or BaseNode(.)[@class='MathML-unit']) and @data-following-space-width >= 0.25" # BANA 5.3(a) @@ -22,7 +22,7 @@ - else_if: "@data-following-space-width > 1.1" then: [t: "⠬"] - else_if: "@data-following-space-width >= 0.25" # thickspace - then: [t: " "] + then: [t: "𝐖"] - name: omission-intent @@ -44,9 +44,12 @@ match: "." replace: # example show use of {}s even when not needed, so no testing - - x: "'\\sqrt{'" + - test: + if: "$LaTeX_UseShortName" + then: [t: "\\s{"] + else: [t: "\\sqrt{"] - x: "*[1]" - - x: "'}'" + - t: "}" - @@ -55,11 +58,14 @@ match: "." replace: # example show use of {}s even when not needed, so no testing - - x: "'\\sqrt['" + - test: + if: "$LaTeX_UseShortName" + then: [t: "\\s["] + else: [t: "\\sqrt["] - x: "*[2]" - - x: "']{'" + - t: "]{" - x: "*[1]" - - x: "'}'" + - t: "}" - name: default @@ -67,11 +73,14 @@ match: "." replace: # example show use of {}s even when not needed, so no testing - - x: "'\\frac{'" + - test: + if: "$LaTeX_UseShortName" + then: [t: "\\f{"] + else: [t: "\\frac{"] - x: "*[1]" - - x: "'}{'" + - t: "}{" - x: "*[2]" - - x: "'}'" + - t: "}" - #GTM 14.3.3 (not sure what else vertical juxtaposition applies to) @@ -79,22 +88,22 @@ tag: mrow match: "IsBracketed(., '(', ')') and *[2][self::m:mfrac][@linethickness=0]" replace: - - x: "'\\binom{'" + - t: "\\binom{" - x: "*[2]/*[1]" - - x: "'}{'" + - t: "}{" - x: "*[2]/*[2]" - - x: "'}'" + - t: "}" - name: binomial-table tag: mrow match: "IsBracketed(., '(', ')') and *[2][self::m:mtable][count(*)=2 and count(*[1])=1] and contains(@intent, 'binomial(')" replace: - - x: "'\\binom{'" + - t: "\\binom{" - x: "*[2]/*[1]/*[1]/*[1]" - - x: "'}{'" + - t: "}{" - x: "*[2]/*[2]/*[1]/*[1]" - - x: "'}'" + - t: "}" # FIX: implement (use \begin{pmatrix} x; & y; & z-3 \end{pmatrix}) # Matrix/Determinant rules @@ -114,13 +123,13 @@ - "(IsBracketed(., '(', ')') or IsBracketed(., '[', ']') or" - " IsBracketed(., '|', '|') or IsBracketed(., '‖', '‖') or IsBracketed(., '{', '}') )" replace: - - x: "'\\begin{'" + - t: "\\begin{" - x: "string($MatrixType)" # need to get $MatrixType eval'd so that it is converted to braille (doesn't work if I do it in 'variables') - - x: "'} '" + - t: "}𝐖" - x: "*[2]" - - x: "'\\end{'" + - t: "\\end{" - x: "string($MatrixType)" # need to get $MatrixType eval'd so that it is converted to braille (doesn't work if I do it in 'variables') - - x: "'} '" + - t: "}𝐖" - name: default-mtable @@ -144,7 +153,7 @@ - x: "*" - test: if: "following-sibling::*" - then: [x: "' \\\\ '"] + then: [t: "𝐖\\\\𝐖"] - name: default @@ -154,13 +163,13 @@ - x: "*" - test: if: "following-sibling::*" - then: [x: "' & '"] + then: [t: "𝐖&𝐖"] - name: no-content tag: math match: "not(*)" # empty - replace: [x: "' '"] # not sure that is right, but this shouldn't happen + replace: [t: "𝐖"] # not sure that is right, but this shouldn't happen - name: default @@ -174,7 +183,7 @@ name: empty-mrow tag: mrow match: "not(*)" - replace: [x: "' '"] # not sure what is correct -- if in a fraction, probably something is better than nothing + replace: [t: "𝐖"] # not sure what is correct -- if in a fraction, probably something is better than nothing - name: default @@ -196,15 +205,6 @@ replace: - t: "⠬" # empty space for omission - -- - name: escaped-char - tag: mo - match: "translate(., '&%$#_{}', '')=''" - replace: - - x: "'\\'" - - x: "text()" - # FIX: need to deal with ~ ^ \ # they have macros \textasciitilde, \textasciicircum, and \textbackslash # these probably aren't appropriate for EuroBraille @@ -217,7 +217,7 @@ - x: "text()" - test: if: "not(preceding-sibling::*)" - then: [t: "⠀"] + then: [t: "𝐖"] - name: default @@ -227,15 +227,15 @@ replace: - test: # if: "DEBUG(parent::m:mrow and DEBUG(not(DEBUG(IsInDefinition(DEBUG(.), 'Braille', 'NoSpacesBefore')))))" - # then: [t: "⠀"] + # then: [t: "𝐖"] if: "parent::m:mrow" then_test: if: "not(IsInDefinition(., 'Braille', 'NoSpacesBefore'))" - then: [t: "⠀"] + then: [t: "𝐖"] - x: "text()" - test: if: "parent::m:mrow and (.=',' or .=';')" # are there others??? - then: [t: "⠀"] + then: [t: "𝐖"] - @@ -249,11 +249,11 @@ # FIX: need to deal with all caps name: named-functions tag: [mi, mtext] - match: "IsInDefinition(., 'Braille', 'LateXFunctionNames')" + match: "IsInDefinition(., 'Braille', 'LateXFunctionNames') and not($LaTeX_UseShortName)" replace: - - x: "'\\'" + - t: "\\" - x: "text()" - - t: "⠀" + - t: "𝐖" - # FIX: need to deal with all caps @@ -283,42 +283,45 @@ - "*[1][substring(., 1, 1)='↽'] and" - "*[2][substring(., string-length(), 1)='⇀']" replace: - - t: "⠀" + - t: "𝐖" - test: if: "*[1][self::m:mrow]" then_test: if: "*[2][self::m:mrow]" - then: [x: "'🣒'"] # this is currently unassigned and may get used by UTC at some point (<=>) - else: [x: "'🣔'"] # this is currently unassigned and may get used by UTC at some point (<<=>) - else: [x: "'🣓'"] # this is currently unassigned and may get used by UTC at some point (<==>>) - - t: " " + then: [t: "🣒"] # this is currently unassigned and may get used by UTC at some point (<=>) + else: [t: "🣔"] # this is currently unassigned and may get used by UTC at some point (<<=>) + else: [t: "🣓"] # this is currently unassigned and may get used by UTC at some point (<==>>) + - t: "𝐖" - name: "hat" tag: "mover" match: "*[2][.='^']" replace: - - x: "'\\hat{'" + - t: "\\hat{" - x: "*[1]" - - x: "'}'" + - t: "}" - name: "bar" tag: "mover" match: "*[2][.='_' or .='¯']" replace: - - x: "'\\overline{'" + - test: + if: "$LaTeX_UseShortName" + then: [t: "\\ol{"] + else: [t: "\\overline{"] - x: "*[1]" - - x: "'}'" + - t: "}" - name: "vector" tag: "mover" match: "*[2][.='→']" replace: - - x: "'\\vec{'" + - t: "\\vec{" - x: "*[1]" - - x: "'}'" + - t: "}" - name: pseudo-scripts @@ -337,27 +340,27 @@ - x: "*[1]" - test: if: "self::m:msup or self::m:mover" - then: [x: "'^'"] - else: [x: "'_'"] + then: [t: "^"] + else: [t: "_"] - test: if: "*[2][IsNode(., 'leaf') and string-length(.) = 1]" then: [x: "*[2]"] else: - - x: "'{'" + - t: "{" - x: "*[2]" - - x: "'}'" + - t: "}" - test: if: "self::m:msubsup or self::m:munderover" then: - - x: "'^'" + - t: "^" - test: if: "*[3][IsNode(., 'leaf') and string-length(.) = 1]" then: [x: "*[3]"] else: - - x: "'{'" + - t: "{" - x: "*[3]" - - x: "'}'" - - t: "⠀" # need to separate script from what follows + - t: "}" + - t: "𝐖" # need to separate script from what follows - name: default tag: mmultiscripts @@ -373,25 +376,25 @@ then: - test: if: "preceding-sibling::*" - then: [x: "'{}'"] # empty base not needed if this is the only expr + then: [t: "{}"] # empty base not needed if this is the only expr - test: if: "not(DEBUG($Prescripts[1])[self::m:none])" then_test: if: "$Prescripts[1][IsNode(., 'leaf') and string-length(.) = 1]" then: [x: "$Prescripts[1]"] else: - - x: "'_{'" + - t: "_{" - x: "$Prescripts[1]" - - x: "'}'" + - t: "}" - test: if: "not($Prescripts[2][self::m:none])" then_test: if: "$Prescripts[2][IsNode(., 'leaf') and string-length(.) = 1]" then: [x: "$Prescripts[2]"] else: - - x: "'^{'" + - t: "^{" - x: "$Prescripts[2]" - - x: "'}'" + - t: "}" - test: if: "count($Prescripts)>2" then: @@ -401,18 +404,18 @@ if: "$Prescripts[3][IsNode(., 'leaf') and string-length(.) = 1]" then: [x: "$Prescripts[3]"] else: - - x: "'_{'" + - t: "_{" - x: "$Prescripts[3]" - - x: "'}'" + - t: "}" - test: if: "not($Prescripts[4][self::m:none])" then_test: if: "$Prescripts[4][IsNode(., 'leaf') and string-length(.) = 1]" then: [x: "$Prescripts[4]"] else: - - x: "'^{'" + - t: "^{" - x: "$Prescripts[4]" - - x: "'}'" + - t: "}" - test: if: "count($Prescripts) > 4" # give up and just dump them out so at least the content is there then: [x: "$Prescripts[position() > 4]"] @@ -427,18 +430,18 @@ if: "$Postscripts[1][IsNode(., 'leaf') and string-length(.) = 1]" then: [x: "$Postscripts[1]"] else: - - x: "'_{'" + - t: "_{" - x: "$Postscripts[1]" - - x: "'}'" + - t: "}" - test: if: "not($Postscripts[2][self::m:none])" then_test: if: "$Postscripts[2][IsNode(., 'leaf') and string-length(.) = 1]" then: [x: "$Postscripts[2]"] else: - - x: "'^{'" + - t: "^{" - x: "$Postscripts[2]" - - x: "'}'" + - t: "}" - test: if: "count($Postscripts)>2" then: @@ -448,18 +451,18 @@ if: "$Postscripts[3][IsNode(., 'leaf') and string-length(.) = 1]" then: [x: "$Postscripts[3]"] else: - - x: "'_{'" + - t: "_{" - x: "$Postscripts[3]" - - x: "'}'" + - t: "}" - test: if: "not($Postscripts[4][self::m:none])" then_test: if: "$Postscripts[4][IsNode(., 'leaf') and string-length(.) = 1]" then: [x: "$Postscripts[4]"] else: - - x: "'^{'" + - t: "^{" - x: "$Postscripts[4]" - - x: "'}'" + - t: "}" - test: if: "count($Postscripts)>4" then: @@ -469,18 +472,18 @@ if: "$Postscripts[5][IsNode(., 'leaf') and string-length(.) = 1]" then: [x: "$Postscripts[5]"] else: - - x: "'_{'" + - t: "_{" - x: "$Postscripts[5]" - - x: "'}'" + - t: "}" - test: if: "not($Postscripts[6][self::m:none])" then_test: if: "$Postscripts[6][IsNode(., 'leaf') and string-length(.) = 1]" then: [x: "$Postscripts[6]"] else: - - x: "'^{'" + - t: "^{" - x: "$Postscripts[6]" - - x: "'}'" + - t: "}" - test: if: "count($Postscripts)>6" then: @@ -490,23 +493,23 @@ if: "$Postscripts[7][IsNode(., 'leaf') and string-length(.) = 1]" then: [x: "$Postscripts[7]"] else: - - x: "'_{'" + - t: "_{" - x: "$Postscripts[7]" - - x: "'}'" + - t: "}" - test: if: "not($Postscripts[8][self::m:none])" then_test: if: "$Postscripts[8][IsNode(., 'leaf') and string-length(.) = 1]" then: [x: "$Postscripts[8]"] else: - - x: "'^{'" + - t: "^{" - x: "$Postscripts[8]" - - x: "'}'" + - t: "}" - test: if: "count($Postscripts) > 8" # give up and just dump them out so at least the content is there then: - x: "$Postscripts[position() > 8]" - - t: "⠀" # need to separate script from what follows + - t: "𝐖" # need to separate script from what follows - @@ -541,14 +544,14 @@ then: # - test: # if: "$AddSpaces" - # then: [t: " "] + # then: [t: "𝐖"] - t: "1⠫⠼⠙" # square (no rectangle in UEB) - test: if: "contains(@notation,'circle')" then: # - test: # if: "$AddSpaces" - # then: [t: " "] + # then: [t: "𝐖"] - t: "1⠫⠿" # circle (no oval in UEB) # ??? What should happen with arrow? # If there is a box/circle with arrows only and an empty child, @@ -619,7 +622,7 @@ - else_if: "contains(@notation,'leftarrow')" then: [t: "1⠳⠪"] - else_if: "contains(@notation,'uparrow')" - then: [t: "1⠳⠬ "] + then: [t: "1⠳⠬𝐖"] - else_if: "contains(@notation,'downarrow')" then: [t: "1⠳⠩"] - else_if: "contains(@notation,'northeastarrow')" @@ -657,7 +660,7 @@ - t: "⠻" # terminate shape # - test: # if: "$AddSpaces" - # then: [t: " "] + # then: [t: "𝐖"] - test: if: "contains(concat(' ', normalize-space(@notation), ' '), ' right ')" #avoid 'rightarrow' then: [t: "⠸"] diff --git a/Rules/Braille/EuroBraille/definitions.yaml b/Rules/Braille/LaTeX/definitions.yaml similarity index 100% rename from Rules/Braille/EuroBraille/definitions.yaml rename to Rules/Braille/LaTeX/definitions.yaml diff --git a/Rules/Braille/LaTeX/unicode.yaml b/Rules/Braille/LaTeX/unicode.yaml new file mode 100644 index 00000000..394ffdf9 --- /dev/null +++ b/Rules/Braille/LaTeX/unicode.yaml @@ -0,0 +1,488 @@ +--- + - " ": [t: "\\space𝐖"] # 0x20 + - "#": [t: "\\#"] # 0x23 + - "$": [t: "\\$"] # 0x24 + - "%": [t: "\\%"] # 0x25 + - "&": [t: "\\&"] # 0x26 + - "'": [t: "\\textquotesingle𝐖"] # 0x27 + - "\\": # 0x5c + - test: + if: "$LaTeX_UseShortName" + then: [t: "\\bs𝐖"] + else: [t: "\\backslash𝐖"] + - "^": [t: "\\^{}"] # 0x5e + - "_": [t: "\\_"] # 0x5f + - "`": [t: "\\textasciigrave𝐖"] # 0x60 + - "{": [t: "\\{"] # 0x7b + - "}": [t: "\\}"] # 0x7d + - "~": [t: "\\textasciitilde𝐖"] # 0x7e + - " ": [t: "\\~"] # 0xa0 + - "¬": [t: "\\neg𝐖"] # 0xac +# - "¬": [t: "\\lnot𝐖"] # 0xac + - "°": [t: "°"] # 0xb0 + - "±": [t: "\\pm𝐖"] # 0xb1 + - "´": [t: "\\textasciiacute𝐖"] # 0xb4 + - "·": [t: "\\cdotp𝐖"] # 0xb7 +# - "·": [t: "\\cdot𝐖"] # 0xb7 + - "×": # 0xd7 + - test: + if: "$LaTeX_UseShortName" + then: [t: "\\x"] + else: [t: "\\times𝐖"] +# - "×": [t: "\\texttimes𝐖"] # 0xd7 + - "÷": [t: "\\div𝐖"] # 0xf7 + - "̀": [t: "\\grave𝐖"] # 0x300 +# - "̀": [t: "\\`"] # 0x300 + - "́": [t: "\\acute𝐖"] # 0x301 +# - "́": [t: "\\'"] # 0x301 + - "̂": [t: "\\hat𝐖"] # 0x302 +# - "̂": [t: "\\^"] # 0x302 + - "̃": [t: "\\tilde𝐖"] # 0x303 +# - "̃": [t: "\\~"] # 0x303 + - "̄": [t: "\\bar𝐖"] # 0x304 +# - "̄": [t: "\\="] # 0x304 + - "̅": [t: "\\overbar𝐖"] # 0x305 + - "̆": [t: "\\breve𝐖"] # 0x306 +# - "̆": [t: "\\u"] # 0x306 + - "̇": [t: "\\dot𝐖"] # 0x307 +# - "̇": [t: "\\."] # 0x307 + - "Ά": [t: "\\'{A}"] # 0x386 + - "Έ": [t: "\\'{E}"] # 0x388 + - "Ή": [t: "\\'{H}"] # 0x389 + - "Ί": [t: "\\'{}{I}"] # 0x38a + - "Ό": [t: "\\'{}O𝐖"] # 0x38c + - "Ύ": [t: "\\mathrm{'Y}"] # 0x38e + - "Ώ": [t: "\\mathrm{'\\Omega}"] # 0x38f + - "ΐ": [t: "\\acute{\\ddot{\\iota}}"] # 0x390 + - "Α": # 0x391 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~A"] + else: [t: "\\Alpha𝐖"] + - "Β": # 0x392 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~B"] + else: [t: "\\Beta𝐖"] + - "Γ": # 0x393 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~G"] + else: [t: "\\Gamma𝐖"] + - "Δ": # 0x394 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~D"] + else: [t: "\\Delta𝐖"] + - "Ε": # 0x395 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~E"] + else: [t: "\\Epsilon𝐖"] + - "Ζ": # 0x396 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~Z"] + else: [t: "\\Zeta𝐖"] + - "Η": # 0x397 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~J"] + else: [t: "\\Eta𝐖"] + - "Θ": # 0x398 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~H"] + else: [t: "\\Theta𝐖"] + - "Ι": # 0x399 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~I"] + else: [t: "\\Iota𝐖"] + - "Κ": # 0x39a + - test: + if: "$LaTeX_UseShortName" + then: [t: "~K"] + else: [t: "\\Kappa𝐖"] + - "Λ": # 0x39b + - test: + if: "$LaTeX_UseShortName" + then: [t: "~L"] + else: [t: "\\Lambda𝐖"] + - "Μ": [t: "\\M"] # 0x39c + - "Ν": [t: "\\N"] # 0x39d + - "Ξ": # 0x39e + - test: + if: "$LaTeX_UseShortName" + then: [t: "~X"] + else: [t: "\\Xi𝐖"] + - "Ο": # 0x39f + - test: + if: "$LaTeX_UseShortName" + then: [t: "~O"] + else: [t: "\\O"] + - "Π": # 0x3a0 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~P"] + else: [t: "\\Pi𝐖"] + - "Ρ": # 0x3a1 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~R"] + else: [t: "\\Rho𝐖"] + - "Σ": # 0x3a3 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~S"] + else: [t: "\\Sigma𝐖"] + - "Τ": # 0x3a4 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~T"] + else: [t: "\\Tau𝐖"] + - "Υ": # 0x3a5 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~U"] + else: [t: "\\Upsilon𝐖"] + - "Φ": # 0x3a6 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~F"] + else: [t: "\\Phi𝐖"] + - "Χ": # 0x3a7 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~C"] + else: [t: "\\Chi𝐖"] + - "Ψ": # 0x3a8 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~Y"] + else: [t: "\\Psi𝐖"] + - "Ω": # 0x3a9 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~W"] + else: [t: "\\Omega𝐖"] + - "Ϊ": [t: "\\mathrm{\\ddot{I}}"] # 0x3aa + - "Ϋ": [t: "\\mathrm{\\ddot{Y}}"] # 0x3ab + - "ά": [t: "\\'{$\\alpha$}"] # 0x3ac + - "έ": [t: "\\acute{\\epsilon}"] # 0x3ad + - "ή": [t: "\\acute{\\eta}"] # 0x3ae + - "ί": [t: "\\acute{\\iota}"] # 0x3af + - "ΰ": [t: "\\acute{\\ddot{\\upsilon}}"] # 0x3b0 + - "α": # 0x3b1 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~a"] + else: [t: "\\alpha𝐖"] + - "β": # 0x3b2 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~b"] + else: [t: "\\beta𝐖"] + - "γ": # 0x3b3 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~g"] + else: [t: "\\gamma𝐖"] + - "δ": # 0x3b4 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~d"] + else: [t: "\\delta𝐖"] + - "ε": # 0x3b5 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~e"] + else: [t: "\\epsilon𝐖"] + - "ζ": # 0x3b6 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~z"] + else: [t: "\\zeta𝐖"] + - "η": # 0x3b7 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~j"] + else: [t: "\\eta𝐖"] + - "θ": # 0x3b8 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~h"] + else: [t: "\\theta𝐖"] + - "ι": # 0x3b9 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~i"] + else: [t: "\\iota𝐖"] + - "κ": # 0x3ba + - test: + if: "$LaTeX_UseShortName" + then: [t: "~k"] + else: [t: "\\kappa𝐖"] + - "λ": # 0x3bb + - test: + if: "$LaTeX_UseShortName" + then: [t: "~l"] + else: [t: "\\lambda𝐖"] + - "μ": # 0x3bc + - test: + if: "$LaTeX_UseShortName" + then: [t: "~m"] + else: [t: "\\mu𝐖"] + - "ν": # 0x3bd + - test: + if: "$LaTeX_UseShortName" + then: [t: "~n"] + else: [t: "\\nu𝐖"] + - "ξ": # 0x3be + - test: + if: "$LaTeX_UseShortName" + then: [t: "~x"] + else: [t: "\\xi𝐖"] + - "ο": # 0x3bf + - test: + if: "$LaTeX_UseShortName" + then: [t: "~o"] + else: [t: "\\o"] + - "π": # 0x3c0 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~p"] + else: [t: "\\pi𝐖"] + - "ρ": # 0x3c1 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~r"] + else: [t: "\\rho𝐖"] + - "ς": [t: "\\varsigma𝐖"] # 0x3c2 + - "σ": # 0x3c3 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~s"] + else: [t: "\\sigma𝐖"] + - "τ": # 0x3c4 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~t"] + else: [t: "\\tau𝐖"] + - "υ": # 0x3c5 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~u"] + else: [t: "\\upsilon𝐖"] + - "φ": [t: "\\varphi𝐖"] # 0x3c6 + - "χ": # 0x3c7 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~c"] + else: [t: "\\chi𝐖"] + - "ψ": # 0x3c8 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~y"] + else: [t: "\\psi𝐖"] + - "ω": # 0x3c9 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~w"] + else: [t: "\\omega𝐖"] + - "ϊ": [t: "\\ddot{\\iota}"] # 0x3ca + - "ϋ": [t: "\\ddot{\\upsilon}"] # 0x3cb + - "ό": [t: "\\'{o}"] # 0x3cc + - "ύ": [t: "\\acute{\\upsilon}"] # 0x3cd + - "ώ": [t: "\\acute{\\omega}"] # 0x3ce + - "ϐ": [t: "\\Pisymbol{ppi022}{87}"] # 0x3d0 + - "ϑ": [t: "\\vartheta𝐖"] # 0x3d1 + - "ϒ": # 0x3d2 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~U"] + else: [t: "\\Upsilon𝐖"] + - "ϕ": # 0x3d5 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~f"] + else: [t: "\\phi𝐖"] + - "ϖ": [t: "\\varpi𝐖"] # 0x3d6 + - "Ϛ": [t: "\\Stigma𝐖"] # 0x3da + - "Ϝ": [t: "\\Digamma𝐖"] # 0x3dc + - "ϝ": [t: "\\digamma𝐖"] # 0x3dd + - "Ϟ": [t: "\\Koppa𝐖"] # 0x3de + - "Ϡ": [t: "\\Sampi𝐖"] # 0x3e0 + - "ϰ": [t: "\\varkappa𝐖"] # 0x3f0 + - "ϱ": [t: "\\varrho𝐖"] # 0x3f1 + - "ϴ": # 0x3f4 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~H"] + else: [t: "\\Theta𝐖"] + - "ϵ": # 0x3f5 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~e"] + else: [t: "\\epsilon𝐖"] + - "϶": [t: "\\backepsilon𝐖"] # 0x3f6 + - "–": [t: "\\textendash𝐖"] # 0x2013 + - "—": [t: "\\---𝐖"] # 0x2014 +# - "—": [t: "\\textemdash𝐖"] # 0x2014 + - "―": [t: "\\horizbar𝐖"] # 0x2015 +# - "―": [t: "\\rule{1em}{1pt}"] # 0x2015 + - "‖": [t: "\\Vert𝐖"] # 0x2016 + - "…": # 0x2026 + - test: + if: "$LaTeX_UseShortName" + then: [t: "\\ld𝐖"] + else: [t: "\\ldots𝐖"] + - "′": [t: "'"] # 0x2032 + - "″": [t: "''"] # 0x2033 + - "‴": [t: "'''"] # 0x2034 + - "ℎ": [t: "\\Planckconst𝐖"] # 0x210e + - "ℜ": [t: "\\Re𝐖"] # 0x211c +# - "ℜ": [t: "\\mathfrak{R}"] # 0x211c + - "Ω": # 0x2126 + - test: + if: "$LaTeX_UseShortName" + then: [t: "~W"] + else: [t: "\\Omega𝐖"] + - "Å": [t: "\\Angstrom𝐖"] # 0x212b +# - "Å": [t: "\\AA𝐖"] # 0x212b + - "←": # 0x2190 + - test: + if: "$LaTeX_UseShortName" + then: [t: "\\la𝐖"] + else: [t: "\\leftarrow𝐖"] + - "↑": # 0x2191 + - test: + if: "$LaTeX_UseShortName" + then: [t: "\\ua𝐖"] + else: [t: "\\uparrow𝐖"] + - "→": [t: "\\to𝐖"] # 0x2192 + - "↓": # 0x2193 + - test: + if: "$LaTeX_UseShortName" + then: [t: "\\da𝐖"] + else: [t: "\\downarrow𝐖"] + - "⇒": [t: "\\Rightarrow𝐖"] # 0x21d2 + - "∀": # 0x2200 + - test: + if: "$LaTeX_UseShortName" + then: [t: "\\fa𝐖"] + else: [t: "\\forall𝐖"] + - "∂": [t: "\\partial𝐖"] # 0x2202 + - "∃": # 0x2203 + - test: + if: "$LaTeX_UseShortName" + then: [t: "\\ex𝐖"] + else: [t: "\\exists𝐖"] + - "∄": [t: "\\nexists𝐖"] # 0x2204 + - "∅": [t: "\\varnothing𝐖"] # 0x2205 + - "∆": [t: "\\increment𝐖"] # 0x2206 + - "∇": [t: "\\nabla𝐖"] # 0x2207 + - "∈": [t: "\\in𝐖"] # 0x2208 + - "∉": [t: "\\notin𝐖"] # 0x2209 +# - "∉": [t: "\\not\\in𝐖"] # 0x2209 + - "∊": [t: "\\smallin𝐖"] # 0x220a + - "∏": [t: "\\prod𝐖"] # 0x220f + - "∐": [t: "\\coprod𝐖"] # 0x2210 + - "∑": [t: "\\sum𝐖"] # 0x2211 + - "−": [t: "\\minus𝐖"] # 0x2212 +# - "−": [t: "\\-"] # 0x2212 + - "∓": [t: "\\mp𝐖"] # 0x2213 + - "∗": [t: "\\ast𝐖"] # 0x2217 +# - "∗": [t: "{_\\ast}"] # 0x2217 + - "∘": [t: "\\vysmwhtcircle𝐖"] # 0x2218 +# - "∘": [t: "\\circ𝐖"] # 0x2218 + - "√": # 0x221a + - test: + if: "$LaTeX_UseShortName" + then: [t: "\\s"] + else: [t: "\\sqrt𝐖"] +# - "√": [t: "\\surd𝐖"] # 0x221a + - "∝": [t: "\\propto𝐖"] # 0x221d +# - "∝": [t: "\\varpropto𝐖"] # 0x221d + - "∞": # 0x221e + - test: + if: "$LaTeX_UseShortName" + then: [t: "\\8"] + else: [t: "\\infty𝐖"] + - "∟": [t: "\\rightangle𝐖"] # 0x221f + - "∠": [t: "\\angle𝐖"] # 0x2220 + - "∡": [t: "\\measuredangle𝐖"] # 0x2221 + - "∣": [t: "\\mid𝐖"] # 0x2223 + - "∤": [t: "\\nmid𝐖"] # 0x2224 + - "∥": # 0x2225 + - test: + if: "$LaTeX_UseShortName" + then: [t: "\\pll𝐖"] + else: [t: "\\parallel𝐖"] + - "∦": [t: "\\nparallel𝐖"] # 0x2226 + - "∧": [t: "\\wedge𝐖"] # 0x2227 + - "∨": [t: "\\vee𝐖"] # 0x2228 + - "∩": [t: "\\cap𝐖"] # 0x2229 + - "∪": [t: "\\cup𝐖"] # 0x222a + - "∫": [t: "\\int𝐖"] # 0x222b + - "∬": [t: "\\iint𝐖"] # 0x222c +# - "∬": [t: "\\int\\!\\int𝐖"] # 0x222c + - "∭": [t: "\\iiint𝐖"] # 0x222d +# - "∭": [t: "\\int\\!\\int\\!\\int𝐖"] # 0x222d + - "∮": [t: "\\oint𝐖"] # 0x222e + - "∶": [t: "\\mathratio𝐖"] # 0x2236 + - "∷": [t: "\\Colon𝐖"] # 0x2237 + - "∼": [t: "\\sim𝐖"] # 0x223c + - "∽": [t: "\\backsim𝐖"] # 0x223d + - "∾": [t: "\\invlazys𝐖"] # 0x223e +# - "∾": [t: "\\lazysinv𝐖"] # 0x223e + - "∿": [t: "\\sinewave𝐖"] # 0x223f + - "≠": [t: "\\not=𝐖"] # 0x2260 + - "≡": # 0x2261 + - test: + if: "$LaTeX_UseShortName" + then: [t: "\\eqv𝐖"] + else: [t: "\\equiv𝐖"] + - "≤": [t: "\\leq𝐖"] # 0x2264 + - "≥": [t: "\\geq𝐖"] # 0x2265 + - "≦": [t: "\\leqq𝐖"] # 0x2266 + - "≧": [t: "\\geqq𝐖"] # 0x2267 + - "≺": [t: "\\prec𝐖"] # 0x227a + - "≻": [t: "\\succ𝐖"] # 0x227b + - "⊂": # 0x2282 + - test: + if: "$LaTeX_UseShortName" + then: [t: "\\sbs𝐖"] + else: [t: "\\subset𝐖"] + - "⊃": # 0x2283 + - test: + if: "$LaTeX_UseShortName" + then: [t: "\\sps𝐖"] + else: [t: "\\supset𝐖"] + - "⊄": [t: "\\nsubset𝐖"] # 0x2284 +# - "⊄": [t: "\\not\\subset𝐖"] # 0x2284 + - "⊅": [t: "\\nsupset𝐖"] # 0x2285 +# - "⊅": [t: "\\not\\supset𝐖"] # 0x2285 + - "⊆": # 0x2286 + - test: + if: "$LaTeX_UseShortName" + then: [t: "\\sbse𝐖"] + else: [t: "\\subseteq𝐖"] +# - "⊆": [t: "\\subseteqq𝐖"] # 0x2286 + - "⊇": # 0x2287 + - test: + if: "$LaTeX_UseShortName" + then: [t: "\\spse𝐖"] + else: [t: "\\supseteq𝐖"] +# - "⊇": [t: "\\supseteqq𝐖"] # 0x2287 + - "△": # 0x25b3 + - test: + if: "$LaTeX_UseShortName" + then: [t: "\\tri𝐖"] + else: [t: "\\triangle𝐖"] + + # invisible chars + - "⁡": [t: ""] # 0x2061 + - "⁢": [t: ""] # 0x2062 + - "⁣": [t: ""] # 0x2063 + - "⁤": [t: ""] # 0x2064 diff --git a/Rules/prefs.yaml b/Rules/prefs.yaml index e26da12c..a8cac3e2 100644 --- a/Rules/prefs.yaml +++ b/Rules/prefs.yaml @@ -81,6 +81,9 @@ SansSerif: "⠈⠼" # first transcriber-defined typeform prefix indicator GreekVariant: "⠸" # default to Greek + LaTeX: + UseShortName: false # Use the short form for the latex (e.g., "~a" instead of "\alpha") + Other: DecimalSeparators: "." # [default] diff --git a/src/braille.rs b/src/braille.rs index f19ce94b..53eb8478 100644 --- a/src/braille.rs +++ b/src/braille.rs @@ -39,7 +39,7 @@ pub fn braille_mathml(mathml: Element, nav_node_id: &str) -> Result<(String, usi "CMU" => cmu_cleanup(pref_manager, braille_string), "Finnish" => finnish_cleanup(pref_manager, braille_string), "Swedish" => swedish_cleanup(pref_manager, braille_string), - "EuroBraille" => eurobraille_cleanup(pref_manager, braille_string), + "LaTeX" => LaTeX_cleanup(pref_manager, braille_string), _ => braille_string.trim_matches('⠀').to_string(), // probably needs cleanup if someone has another code, but this will have to get added by hand }; @@ -2022,15 +2022,22 @@ fn swedish_cleanup(pref_manager: Ref, raw_braille: String) -> return result.to_string(); } - -fn eurobraille_cleanup(_pref_manager: Ref, raw_braille: String) -> String { +#[allow(non_snake_case)] +fn LaTeX_cleanup(_pref_manager: Ref, raw_braille: String) -> String { lazy_static! { - static ref REMOVE_SPACE: Regex =Regex::new(r"⠀([⡮⡸⠂⠆⠴⡾⠾])").unwrap(); // '^', '_', ',', ';', ')', ']', '}' + // static ref REMOVE_SPACE: Regex =Regex::new(r"⠀([⡮⡸⠂⠆⠴⡾⠾])").unwrap(); // '^', '_', ',', ';', ')', ']', '}' + static ref REMOVE_SPACE: Regex =Regex::new(r" ([\^_,;)\]}])").unwrap(); // '^', '_', ',', ';', ')', ']', '}' + static ref COLLAPSE_SPACES: Regex = Regex::new(r" +").unwrap(); } - // debug!("eurobraille_cleanup: start={}", raw_braille); - let result = COLLAPSE_SPACES.replace_all(&raw_braille, "⠀"); // probably not needed + debug!("LaTeX_cleanup: start={}", raw_braille); + let result = raw_braille.replace("𝐖", " "); + // let result = COLLAPSE_SPACES.replace_all(&raw_braille, "⠀"); + let result = COLLAPSE_SPACES.replace_all(&result, " "); + debug!("After collapse: {}", &result); let result = REMOVE_SPACE.replace_all(&result, "$1"); - let result = result.trim_matches('⠀'); + debug!("After remove: {}", &result); + // let result = result.trim_matches('⠀'); + let result = result.trim_matches(' '); return result.to_string(); } diff --git a/src/main.rs b/src/main.rs index aaf4e241..ac394c26 100644 --- a/src/main.rs +++ b/src/main.rs @@ -169,55 +169,24 @@ fn main() { // // // "; - let expr=r#" - + + let expr = r#" + + + + + 2 + + - e - - - - 1 - 2 - - - - - ( - - - - x - - μ - - σ - - - ) - - - 2 - - + x + 2 + - "#; - -// let expr = " -// -// -// -// A -// -// x -// -// + -// b -// -// -// "; + "#; // let expr= "sin(x)+f(x)"; let instant = Instant::now(); let rules_dir = std::env::current_exe().unwrap().parent().unwrap().join("../../Rules"); @@ -252,7 +221,7 @@ fn main() { info!("SpeechStyle: {:?}", get_preference("SpeechStyle".to_string()).unwrap()); - set_preference("BrailleCode".to_string(), "Nemeth".to_string()).unwrap(); + set_preference("BrailleCode".to_string(), "LaTeX".to_string()).unwrap(); match get_braille("".to_string()) { Ok(braille) => info!("Computed braille string:\n '{}'", braille), Err(e) => panic!("{}", errors_to_string(&e)), @@ -275,7 +244,7 @@ fn main() { // info!("#xpath = {}; duplicates = {}", xpath_counts.0, xpath_counts.1); info!("Time taken (second time for speech + braille): {}ms", instant.elapsed().as_millis()); - timing_test(expr, 200); + timing_test(expr, 0); } diff --git a/tests/braille.rs b/tests/braille.rs index 7bd6f1ed..12a7892a 100644 --- a/tests/braille.rs +++ b/tests/braille.rs @@ -22,7 +22,7 @@ mod braille { mod vi; } - mod EuroBraille { + mod LaTeX { mod augenbit; } } diff --git a/tests/braille/EuroBraille/augenbit.rs b/tests/braille/LaTeX/augenbit.rs similarity index 68% rename from tests/braille/EuroBraille/augenbit.rs rename to tests/braille/LaTeX/augenbit.rs index 537a8933..6173b9ea 100644 --- a/tests/braille/EuroBraille/augenbit.rs +++ b/tests/braille/LaTeX/augenbit.rs @@ -1,4 +1,4 @@ -// Eurobraille tests for the basic mathml tags. +// LaTeX tests for the basic mathml tags. // These come from three pages: // https://augenbit.de/wiki/index.php?title=LaTeX-Manual_LaTeX_Grundregeln // https://augenbit.de/wiki/index.php?title=LaTeX-Manual_Sekundarstufe_1 @@ -13,67 +13,67 @@ use crate::common::*; #[test] fn augenbit0_1_1 () { let expr = "2+x=5"; - test_braille("EuroBraille", expr, "⠣⠀⠖⠭⠀⠶⠱"); + test_braille("LaTeX", expr, r"2 +x =5"); } #[test] fn augenbit0_1_2 () { let expr = "|x-1|=|1-x|"; - test_braille("EuroBraille", expr, "⠌⠀⠭⠀⠤⠡⠌⠀⠶⠌⠀⠡⠀⠤⠭⠌"); + test_braille("LaTeX", expr, r"| x -1| =| 1 -x|"); } #[test] fn augenbit0_1_3 () { let expr = "n!=n*(n-1)!"; - test_braille("EuroBraille", expr, "⠝⠐⠀⠶⠝⠀⠔⠦⠝⠀⠤⠡⠴⠐"); + test_braille("LaTeX", expr, r"n! =n *(n -1)!"); } #[test] fn augenbit0_2_1 () { let expr = "x2"; - test_braille("EuroBraille", expr, "⠭⡮⠣"); + test_braille("LaTeX", expr, r"x^2"); } #[test] fn augenbit0_2_2 () { let expr = "x10"; - test_braille("EuroBraille", expr, "⠭⡮⠷⠡⠬⠾"); + test_braille("LaTeX", expr, r"x^{10}"); } #[test] fn augenbit0_2_3 () { let expr = "a1+an"; - test_braille("EuroBraille", expr, "⠁⡸⠡⠀⠖⠁⡸⠝"); + test_braille("LaTeX", expr, r"a_1 +a_n"); } #[test] fn augenbit0_2_4 () { let expr = "xn+m"; - test_braille("EuroBraille", expr, "⠭⡮⠷⠝⠀⠖⠍⠾"); + test_braille("LaTeX", expr, r"x^{n +m}"); } #[test] fn augenbit0_3_1 () { let expr = "n"; - test_braille("EuroBraille", expr, "⠝⠀⡌⠞⠕⠀⡌⠊⠝⠋⠞⠽"); + test_braille("LaTeX", expr, r"n \to \infty"); } #[test] fn augenbit0_3_2 () { let expr = "x{3;4}"; - test_braille("EuroBraille", expr, "⠭⠀⡌⠝⠕⠞⠊⠝⠀⡌⠷⠩⠆⠀⠹⡌⠾"); + test_braille("LaTeX", expr, r"x \notin \{3; 4\}"); } #[test] fn augenbit0_4_1 () { let expr = "a+ba-b"; - test_braille("EuroBraille", expr, "⡌⠋⠗⠁⠉⠷⠁⠀⠖⠃⠾⠷⠁⠀⠤⠃⠾"); + test_braille("LaTeX", expr, r"\frac{a +b}{a -b}"); } #[test] fn augenbit0_4_2 () { let expr = "a+b"; - test_braille("EuroBraille", expr, "⡌⠎⠟⠗⠞⠷⠁⠀⠖⠃⠾"); + test_braille("LaTeX", expr, r"\sqrt{a +b}"); } #[test] @@ -82,37 +82,45 @@ fn augenbit0_4_3 () { n=1 12n=1 "#; - test_braille("EuroBraille", expr, "⡌⠎⠥⠍⡸⠷⠝⠀⠶⠡⠾⡮⡌⠊⠝⠋⠞⠽⠀⡌⠋⠗⠁⠉⠷⠡⠾⠷⠣⡮⠝⠾⠀⠶⠡"); + test_braille("LaTeX", expr, r"\sum_{n =1}^\infty \frac{1}{2^n} =1"); } #[test] fn augenbit0_5_1 () { let expr = r#"AB"#; - test_braille("EuroBraille", expr, "⡌⠕⠧⠑⠗⠇⠊⠝⠑⠷⡁⠀⡌⠉⠥⠏⠀⡃⠾"); + test_braille("LaTeX", expr, r"\overline{A \cup B}"); } #[test] fn augenbit1_1_1 () { let expr = r#"{1,2,3,4}"#; - test_braille("EuroBraille", expr, "⡌⠷⠀⠡⠂⠀⠣⠂⠀⠩⠂⠀⠹⠀⡌⠾"); + test_braille("LaTeX", expr, r"\{ 1, 2, 3, 4 \}"); } #[test] fn augenbit1_2_3 () { - let expr = r#"935"#; - test_braille("EuroBraille", expr, "⠪⠀⠤⠩⠀⡌⠝⠕⠞⠶⠀⠱"); + let expr = r#"0-"#; + test_braille_prefs("LaTeX", vec![("LaTeX_UseShortName", "false" )], expr, r"\mathbb Z_0^-"); + test_braille_prefs("LaTeX", vec![("LaTeX_UseShortName", "true")], expr, r"\Z_0^-"); } #[test] fn augenbit1_3_2 () { - let expr = r#"x±3"#; - test_braille("EuroBraille", expr, "⠭⠀⡌⠏⠍⠀⠩"); + let expr = r#"935"#; + test_braille("LaTeX", expr, r"9 -3 \not= 5"); } #[test] fn augenbit1_3_3 () { let expr = r#"x±3"#; - test_braille("EuroBraille", expr, "⠭⠀⡌⠏⠍⠀⠩"); + test_braille("LaTeX", expr, r"x \pm 3"); +} + +#[test] +fn augenbit1_5_2 () { + let expr = r#"1x"#; + test_braille_prefs("LaTeX", vec![("LaTeX_UseShortName", "false" )], expr, r"\frac{1}{x}"); + test_braille_prefs("LaTeX", vec![("LaTeX_UseShortName", "true")], expr, r"\f{1}{x}"); } #[test] @@ -124,7 +132,7 @@ fn augenbit1_5_7 () { = 1/6 "#; - test_braille("EuroBraille", expr, "⠬⠂⠡⡌⠕⠧⠑⠗⠇⠊⠝⠑⠷⠫⠾⠀⠶⠡⠲⠫"); + test_braille("LaTeX", expr, r"0,1\overline{6} =1/6"); } #[test] @@ -133,7 +141,7 @@ fn augenbit1_6_8 () { a23= a2/3 "#; - test_braille("EuroBraille", expr, "⡌⠎⠟⠗⠞⡷⠩⡾⠷⠁⡮⠣⠾⠀⠶⠁⡮⠷⠣⠲⠩⠾"); + test_braille("LaTeX", expr, r"\sqrt[3]{a^2} =a^{2/3}"); } #[test] @@ -147,38 +155,39 @@ fn augenbit1_6_11() { U "#; - test_braille("EuroBraille", expr, "⡸⠷⠪⠱⠾⡮⠷⠣⠩⠳⠾⡥"); + test_braille("LaTeX", expr, r"_{95}^{238}U"); } #[test] fn augenbit1_7_7 () { let expr = r#"logax"#; - test_braille("EuroBraille", expr, "⡌⠇⠕⠛⡸⠁⠀⠭"); + test_braille("LaTeX", expr, r"\log_a x"); } #[test] fn augenbit1_7_10 () { let expr = r#"cos2β"#; - test_braille("EuroBraille", expr, "⡌⠉⠕⠎⡮⠣⠀⡌⠃⠑⠞⠁"); + test_braille_prefs("LaTeX", vec![("LaTeX_UseShortName", "false" )], expr, r"\cos^2 \beta"); + test_braille_prefs("LaTeX", vec![("LaTeX_UseShortName", "true")], expr, r"cos^2 ~b"); } #[test] fn augenbit1_7_12 () { let expr = r#"cot45°"#; - test_braille("EuroBraille", expr, "⡌⠉⠕⠞⠀⠹⠱⢸"); + test_braille("LaTeX", expr, r"\cot 45°"); } #[test] fn augenbit1_8_2 () { let expr = r#"ABC"#; - test_braille("EuroBraille", expr, "⡌⠞⠗⠊⠁⠝⠛⠇⠑⠀⡁⡃⡉"); + test_braille("LaTeX", expr, r"\triangle ABC"); } #[test] fn augenbit1_8_4 () { let expr = r#"α,β,γ,δ,ϵ"#; - test_braille("EuroBraille", expr, "⡌⠁⠇⠏⠓⠁⠂⠀⡌⠃⠑⠞⠁⠂⠀⡌⠛⠁⠍⠍⠁⠂⠀⡌⠙⠑⠇⠞⠁⠂⠀⡌⠑⠏⠎⠊⠇⠕⠝"); + test_braille("LaTeX", expr, r"\alpha, \beta, \gamma, \delta, \epsilon"); } #[test] @@ -188,7 +197,7 @@ fn augenbit2_1_4 () { f' (x), f''(x) "#; - test_braille("EuroBraille", expr, "⠋⠠⠦⠭⠴⠂⠀⠋⠠⠠⠦⠭⠴"); + test_braille("LaTeX", expr, r"f'(x), f''(x)"); } #[test] @@ -203,6 +212,6 @@ fn augenbit2_3_2 () { "#; // set number preferences to European style - test_braille_prefs("EuroBraille", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, - "⡌⠧⠑⠉⠷⠟⠾⠀⠶⠀⡌⠃⠑⠛⠊⠝⠷⠏⠍⠁⠞⠗⠊⠭⠾⠀⠤⠱⠀⡌⡌⠀⠬⠂⠱⠀⡌⡌⠀⠅⠖⠹⠀⡌⠑⠝⠙⠷⠏⠍⠁⠞⠗⠊⠭⠾"); + test_braille_prefs("LaTeX", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, + r"\vec{q} = \begin{pmatrix} -5 \\ 0,5 \\ k+4 \end{pmatrix}"); } diff --git a/tests/common/mod.rs b/tests/common/mod.rs index e2bca48f..022c6b08 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -109,6 +109,7 @@ pub fn test_ClearSpeak_prefs(language: &str, prefs: Vec<(&str, &str)>, mathml: & pub fn test_braille(code: &str, mathml: &str, braille: &str) { set_rules_dir(abs_rules_dir_path()).unwrap(); set_preference("BrailleCode".to_string(), code.to_string()).unwrap(); + set_preference("LaTeX_UseShortName".to_string(), "false".to_string()).unwrap(); // FIX: this shouldn't need to be done -- need to figure out how to get definitions set automatically // log::debug!("\nsetting Language"); match code {