Skip to content

Commit

Permalink
Allow searching for subscript numbers (e.g. H2O)
Browse files Browse the repository at this point in the history
  • Loading branch information
haukex committed Aug 11, 2024
1 parent e9fc60f commit 47c2250
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
6 changes: 3 additions & 3 deletions dict-check.pl
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ =head2 Author, Copyright, and License
\N{GREEK SMALL LETTER LAMDA}
\N{GREEK CAPITAL LETTER OMEGA}
] )
| [0-9]
| [ \N{SUBSCRIPT ZERO} - \N{SUBSCRIPT NINE} ]
# Note subscript digits happen to be in sequence in Unicode (U+2080 - U+2089), but superscripts aren't!
| [ 0-9 \N{SUBSCRIPT ZERO} - \N{SUBSCRIPT NINE} \N{SUPERSCRIPT TWO} \N{SUPERSCRIPT THREE} ]
# ##### ##### Special Sequences ##### #####
# characters we would otherwise treat specially
Expand All @@ -148,7 +148,7 @@ =head2 Author, Copyright, and License
# We also treat quotation marks specially below.
| (?!::) [ \x20 ! $ % & + , \- . / : = ? ~ ' \N{RIGHT SINGLE QUOTATION MARK}
\N{EN DASH} \N{DEGREE SIGN} \N{SECTION SIGN} \N{HORIZONTAL ELLIPSIS} \N{MICRO SIGN}
\N{SUPERSCRIPT TWO} \N{SUPERSCRIPT THREE} \N{VULGAR FRACTION ONE HALF} \N{MULTIPLICATION SIGN}
\N{VULGAR FRACTION ONE HALF} \N{MULTIPLICATION SIGN}
\N{EURO SIGN} \N{POUND SIGN} \N{REGISTERED SIGN} ]
)
Expand Down
14 changes: 10 additions & 4 deletions src/js/equiv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,16 @@ const EQUIV :[string[], string[]][] = [
[ ['...', '…'], [] ],
[ ['"', '“', '”', '„'], [] ],
// other special sequences
[ ['^2'], ['²'] ],
[ ['^3'], ['³'] ],
[ ['m2'], ['m²'] ],
[ ['m3'], ['m³'] ],
[ ['0'], ['₀'] ],
[ ['1'], ['₁'] ],
[ ['2'], ['₂','²'] ],
[ ['3'] , ['₃','³'] ],
[ ['4'], ['₄'] ],
[ ['5'], ['₅'] ],
[ ['6'], ['₆'] ],
[ ['7'], ['₇'] ],
[ ['8'], ['₈'] ],
[ ['9'], ['₉'] ],
[ ['1/2'], ['½'] ],
[ ['*', 'x'], ['×'] ],
[ ['(R)'], ['®'] ],
Expand Down

0 comments on commit 47c2250

Please sign in to comment.