Character Tables and Tokenizer for Mathics and the Wolfram Language.
Project description
Mathics Character Tables and Scanner
This repository really contains two things:
extensive tables describing WL symbols and operators their properties
a tokenizer or scanner portion for the Wolfram Language.
With respect to the first item, there is a commented YAML that contains a full set of translation between:
Wolfram Language named characters,
Unicode/ASCII equivalents and Unicode and WL code-points,
AMSLaTeX equivalent names,
Operator name (if symbol is an operator),
Operator precedence (if an operator)
Keyboard escape sequences for the symbol
Uses
The scanner and character tables are used inside Mathics. However information can also be used by other programs for tokenizing and formatting Wolfram Language code.
For example, tables are used in mathics-pygments, a Pygments-based lexer and highlighter for Mathematica/Wolfram Language source code.
This library may be useful if you need to work with Wolfram Language named character and convert them to various formats.
Usage
For tokenizing and scanning Wolfram Language code, use the mathics_scanner.tokenizer.Tokenizer class.
To convert between Wolfram Language named characters and Unicode/ASCII, use the mathics_scanner.characters.replace_wl_with_plain_text and mathics_scanner.characters.replace_unicode_with_wl functions.
To convert between qualified names of named characters (such FormalA for \[FormalA]) and Wolfram’s internal representation use the m̀athics_scanner.characters.named_characters dictionary.
To regenerate JSON-format tables run:
$ mathics-generate-json-table
Without options mathics-generate-json-table produces the maximum set of correspondences.
In most applications though you may need just a few of these. The --field option can be used to narrow the list of entries to output in JSON. Run mathics-generate-json-table --help for a full list of fields.
Implementation
For notes on the implementation of the packages or details on the conversion scheme please read Implementation.
Contributing
Please feel encouraged to contribute to this package or Mathics! Create your own fork, make the desired changes, commit, and make a pull request.
License
Mathics is released under the GNU General Public License Version 3 (GPL3).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for Mathics_Scanner-1.3.0-py3.11.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b31107124ceeabd50d672de280dec195b07a2ca8d469cbcc14f41886973c1ee |
|
MD5 | cf2735ad00db90d19cc662ad8c8e23e8 |
|
BLAKE2b-256 | cdd61b1bb63a8b789396ddcf27ccd5d01b17071895e8fde10980d79d72f4f2c7 |
Hashes for Mathics_Scanner-1.3.0-py3.10.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4af0d7bb8736bbc28eefd78ea6ad5b7d79c655997d34d07973059710ca421582 |
|
MD5 | b89a87b62af574740d24924bfeedd6eb |
|
BLAKE2b-256 | 6452e5c372a2ef68031dfb322ed759822f56ed43afcda85a18afdff7e0c08c18 |
Hashes for Mathics_Scanner-1.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b3f0c4bc81374c85146315a6db39412ad3225a0a6714ea8bc0793a060e44885 |
|
MD5 | 468558b5e300c0a055ad44d45ddffb02 |
|
BLAKE2b-256 | 0795ff0686d4599dfe6c6aabf40c99adbfa0106b4ae88166bb69a34005ed7f7e |
Hashes for Mathics_Scanner-1.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa9d75fe26719976b05f36fe012c56536d644ba6c51e61c2de4265f247d51d4a |
|
MD5 | 6d0ca2aef31b19675903d181f365493f |
|
BLAKE2b-256 | f84c295babdcbca550378dce87e4991c7d9859ceddf46275bcb01dcc26c23212 |