Skip to main content

Questions tagged [parsing]

Questions about built-in/custom parsers or parsing techniques.

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 <...
lesobrod's user avatar
  • 2,130
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 ...
Nasser's user avatar
  • 153k
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 ...
Lacia's user avatar
  • 3,098
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, ......
imida k's user avatar
  • 4,405
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 ...
ForceBru's user avatar
  • 175
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: ...
Walhiskaz's user avatar
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 "...
Gert's user avatar
  • 1,752
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. ...
katifa sh's user avatar
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 ...
Anti Earth's user avatar
  • 1,290
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 ...
Hauke Reddmann's user avatar
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 ...
Gravifer's user avatar
  • 924
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 ...
Anton Antonov's user avatar
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 ...
aresnick's user avatar
  • 111
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 ...
cab20's user avatar
  • 125
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 ...
user74549's user avatar
  • 317

15 30 50 per page
1
2 3 4 5
7