Questions tagged [parsing]
Questions about built-in/custom parsers or parsing techniques.
93 questions
1
vote
4
answers
123
views
Parse data with patterns
If
arr = {1, {2, 3}};
we get {{2, 3}} from
Cases[arr, {a___, b___} :> {a, b}]
But if
<...
6
votes
2
answers
175
views
Is there a system option to make Mathematica generate syntax error when reading code from file which has red syntax warning in frontend?
I type some equations from text books into database, which later read from Mathematica to solve.
Since I do this manually, sometimes I make mistakes where I type ...
4
votes
1
answer
155
views
Is it possible to improve efficiency of the function?
I have the following function scriptQ to check whether an expression is a "script" or not.
This function is frequently called by others, so I need to ...
5
votes
1
answer
211
views
Validate `Box` grammar, is it possible?
Is it possible to validate grammar related to Box formed expression (RowBox, FractionBox, ......
1
vote
1
answer
100
views
Why does `a&/.b` parse as `(a&)/.b` if `a&` has lower precedence than `x/.y`? [closed]
The documentation says that expr& has lower precedence than expr1 /. expr2. Thus, parsing should start from operators with ...
2
votes
1
answer
90
views
Why does the console REPL parse input differently from ToExpression?
In the console REPL, we can see that input is parsed in a certain way, that is not equivalent to simply calling ToExpression on the input string. From math.exe using Mathematica 13.1:
...
0
votes
0
answers
129
views
Parsing of WL code
Upon opening a .wl file someone send me I noticed that about 20 seconds were spend parsing the file. Sometimes it spends less time doing so for much bigger files. Upon looking up the term "...
1
vote
2
answers
99
views
Parsing data from site
I try parse hub titles and links from this site: https://habr.com/en/hubs/, but code returns empty list. Can not understand why.
...
2
votes
0
answers
976
views
Input subscripts in Wolfram Cloud
I would like to input "rendered" subscripts in Wolfram Cloud, without having to verbosely type Subscript[a, b]. The local notebook shortcut is ...
3
votes
2
answers
257
views
Custom bracket parser
I have a function $F$ taking arbitrarily many arguments from ${a,c,z}$ where practically (technically it isn't) $a$ works as an opening bracket and $z$ as a closing. ($c$ stands for a value.) Double ...
18
votes
2
answers
657
views
How to create a CLI for Wolfram language scripts?
Former question: How to use wolframscript to develop flexible command-line tools?
I am currently changing a notebook into a wolframscript for a "production" environment,
where I plan to ...
16
votes
1
answer
573
views
How can I ingest and analyze benchmark results posted at MSE?
How can I ingest Mathematica / WL benchmark results posted at Mathematica Stack Exchange (MSE), like the ones posted here?
Assumptions:
There are multiple answers with benchmarks posted
The ...
1
vote
0
answers
45
views
Distinguishing function calls from multiplication when importing LaTeX via ToExpression and TeXForm
I'm trying to parse a LaTeX representation of a Desmos calculator (like this one) via Mathematica.
Desmos exposes a JSON representation of its calculators, including a LaTeX representation of ...
1
vote
1
answer
85
views
Parse coefficients from a Resolve output
I have a huge output from Resolve (quantifier elimination) that I must parse to extract the coefficients as numbers. Take for instance something that looks like ...
1
vote
2
answers
546
views
How to extract data and attribute data from an XMLElement
I am trying to write a function to extract both the data and the attribute data from an XMLElement in the same pass. I have followed the examples from Mathematica's Transforming XML tutorial and the ...