Skip to main content

Questions tagged [parsing]

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

Filter by
Sorted by
Tagged with
2 votes
1 answer
130 views

Suppose we have an expression in InputForm as a string. The task is to find position of corresponding parentheses. For example parenthesis at position ...
azerbajdzan's user avatar
  • 32.8k
1 vote
4 answers
187 views

If arr = {1, {2, 3}}; we get {{2, 3}} from Cases[arr, {a___, b___} :> {a, b}] But if <...
lesobrod's user avatar
  • 2,590
6 votes
2 answers
220 views

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
  • 156k
4 votes
1 answer
189 views

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 ...
Acacia's user avatar
  • 3,467
5 votes
1 answer
241 views

Is it possible to validate grammar related to Box formed expression (RowBox, FractionBox, ......
imida k's user avatar
  • 4,435
1 vote
1 answer
147 views

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
119 views

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
151 views

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,783
1 vote
2 answers
123 views

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
1k views

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,310
3 votes
2 answers
291 views

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
754 views

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
  • 926
16 votes
1 answer
642 views

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
65 views

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
118 views

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
631 views

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
2 votes
1 answer
470 views

I want to extract information from executable files, such as the names and sizes of sections, symbols, etc. The Wikipedia article has a diagram showing the layout of a PE. See also this diagram It ...
flinty's user avatar
  • 26.3k
6 votes
4 answers
772 views

I have written a method to turn systems of linear differential equations into matrix equations (discretisation). This handles boundary conditions using the row replacement method. At the moment, I ...
jrekier's user avatar
  • 525
10 votes
2 answers
397 views

NB: I am aware of the DeleteStopwords symbol. I want to remove from a list of words the ones that are likely to be more banal. So for instance if we have ...
Diffycue's user avatar
  • 1,973
14 votes
2 answers
281 views

This code works fine in a string based interface like WolframScript or Mathematica Kernel. Run this through a string based interface ...
Roman's user avatar
  • 51.3k
4 votes
3 answers
169 views

I need to parse some xml code. I need to extract some values withing pattern elements. I made an example of my trouble. Here is some complicated xml list: ...
VasilySH's user avatar
3 votes
0 answers
243 views

Exporting to JSON is working well for me under 11.3. The issue present in previous versions seem to be solved: ...
Gustavo Delfino's user avatar
11 votes
1 answer
235 views

I'm trying to do lexical scanning and parsing in a toy language. One with just functions (of the form $f(a,\,b,\,c,\,...)$, ended with semicolons) and special tokens (such as ...
Nico A's user avatar
  • 3,734
2 votes
0 answers
96 views

I have been experimenting with GrammarRules in an attempt to create a parser for text downloaded from the web. I have been using Interpreter to help understand the behavior of GrammarApply. Here is a ...
Mike Colacino's user avatar
11 votes
1 answer
138 views

Bug introduced in V10.4 or earlier and persisting through V11.3 [CASE:4072996] ...
Kuba's user avatar
  • 139k
9 votes
4 answers
3k views

I am a Wolfram Language/Mathematica beginner and trying to convert STEP ISO10303 commands into geometrical regions. A simple command looks like ...
markilux's user avatar
  • 121
6 votes
1 answer
1k views

Introduction This is really a parsing question. But the context is that given the right side of first order ode, I want to automatically determine the class of the RHS. It can be either separable, ...
Nasser's user avatar
  • 156k
20 votes
1 answer
594 views

Too long? Go to Problems section Background I like to learn by doing small, sometimes artificial, projects. Among other things I had 'parsers', and 'stream methods / streams in MMA' on my to learn ...
Kuba's user avatar
  • 139k
12 votes
3 answers
597 views

Is there already a markdown to XML parser implemented in Mathematica? I wrote a one for my pelican rewrite, but realized I should have asked here first. Mine is almost certainly faulty in a few major ...
b3m2a1's user avatar
  • 48k
7 votes
2 answers
555 views

This is for the purpose of generating a string (actually it will Latex string, but that is not important). I need to generate string as ...
Nasser's user avatar
  • 156k
6 votes
1 answer
137 views

This the second question of (152743), the preamble of which is reproduced here: Those who don't have/prefer the front end of Mathematica will either use a plain ASCII editor to write a script in an <...
QuantumDot's user avatar
  • 19.9k
5 votes
1 answer
164 views

Those who don't have/prefer the front end of Mathematica will either use a plain ASCII editor to write a script in an .m file or just use Mathematica directly from ...
QuantumDot's user avatar
  • 19.9k
1 vote
0 answers
128 views

I've been working on scraping an article from CNBC. The link is here I want to scrape the main body, and the code I have so far is this: ...
Vic Jongmin Youn's user avatar
1 vote
1 answer
281 views

I have a very ugly function with 157 terms that I want to integrate over three variables. Each term is a Gaussian integral in those variables multiplied by a polynomial in the variables. However, in ...
Joe's user avatar
  • 175
3 votes
1 answer
660 views

Having a bit of trouble pulling a value out of a JSON Association here. I am scraping this website: http://www.msn.com/en-us/money/stockdetails/history/fi-126.1.BY.NYS I want to scrape the closing ...
Vic Jongmin Youn's user avatar
0 votes
0 answers
538 views

I'm working with some scraping and have run into a bit of a problem. The website I am scraping is this: https://seekingalpha.com/symbol/CRM/stocktalks I am essentially trying to scrape the "stock ...
Vic Jongmin Youn's user avatar
1 vote
1 answer
128 views

I've been working with some web scraping and have run into a wall. The website I'm working with is this: https://seekingalpha.com/symbol/TWLO/stocktalks I am trying to scrape all of the "stock talks" ...
Vic Jongmin Youn's user avatar
2 votes
1 answer
634 views

I've run into a little question while trying to parse XML. This seems like a rather simple task, but for the life of me I cannot figure it out. I pull up the XML of the website using the following ...
Vic Jongmin Youn's user avatar
2 votes
2 answers
675 views

I have been trying to parse command line arguments. There are a couple of types of options. 1. Mandatory 2. Optional 3. Alternative There are built-in/3rd ...
webcpu's user avatar
  • 3,258
6 votes
0 answers
166 views

Bug introduced in 9.0 or earlier and persisting through 11.1 First off: ...
Martin Ender's user avatar
  • 8,856
9 votes
3 answers
4k views

please forgive me if this is obvious, but I have some JSON: ...
Joe Blow's user avatar
  • 417
3 votes
0 answers
40 views

I am confused about how Read separates elements. The following all work fine: ...
Szabolcs's user avatar
  • 239k
5 votes
1 answer
283 views

Consider the following code: Begin["mycontext`"]; myvar = 7; Print[Context[]]; Print[Context[myvar]]; End[]; with the output mycontext` mycontext` Now ...
image357's user avatar
  • 517
3 votes
2 answers
1k views

How are you? I'm a chemist with almost no experience with Mathematica, but I'm thinking of using it as a tool for my Ph.D in Computational Chemistry. My Quantum Chemistry software (ORCA) generates a ...
HCSthe2nd's user avatar
  • 193
1 vote
2 answers
283 views

How is a~b parsed and evaluated? I would expect an error, but it goes through without any complaints, yielding no apparent output. At first I thought it evaluated ...
jjc385's user avatar
  • 3,503
4 votes
1 answer
113 views

The very first example in the Dataset documentation is the following: ...
user70061's user avatar
3 votes
1 answer
156 views

Here is code that I thought would make the front end parse f as BigFunction: ...
QuantumDot's user avatar
  • 19.9k
11 votes
4 answers
2k views

In C#, we can use regular expression to do some balancing groups, like we can get {<aa <bbb> <bbb> aa>, <<dfa>a>} from ...
yode's user avatar
  • 27.8k
19 votes
4 answers
968 views

The Notebook interface has a parser that seems aware of all operator-precedences, allowing us to step through the expressions (rather: Box-) hierarchy with Ctrl+. This is extremely convenient, saving ...
masterxilo's user avatar
  • 5,829
6 votes
1 answer
124 views

Read[stream, Number] will return a single read number. We can use a number of standard, documented types instead of Number, ...
Szabolcs's user avatar
  • 239k