-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Unicode subscripts when parsing spin-{orbitals,configurations} (
#41)
- Loading branch information
Showing
5 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
function from_subscript(s) | ||
inverse_subscript_map = Dict('₋' => '-', '₊' => '+', '₀' => '0', | ||
'₁' => '1', '₂' => '2', '₃' => '3', | ||
'₄' => '4', '₅' => '5', '₆' => '6', | ||
'₇' => '7', '₈' => '8', '₉' => '9', | ||
'₀' => '0') | ||
map(Base.Fix1(getindex, inverse_subscript_map), s) | ||
end | ||
|
||
function from_superscript(s) | ||
inverse_superscript_map = Dict('⁻' => '-', '⁺' => '+', '⁰' => '0', | ||
'¹' => '1', '²' => '2', '³' => '3', | ||
'⁴' => '4', '⁵' => '5', '⁶' => '6', | ||
'⁷' => '7', '⁸' => '8', '⁹' => '9', | ||
'⁰' => '0') | ||
map(Base.Fix1(getindex, inverse_superscript_map), s) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters