mathnet/mathnet-symbolics

Cannot parse MathML

narem81 opened this issue · 6 comments

Hello,
First of all, congratulations for Math.Net. It's a wonderful project. You've done a great job.

I'm trying to use Symbolics in a project where I need to parse a standard syntax in order to import expressions.
I didn't find anything about LATEX parsing, but I found a method for parsing MathML: SymbolicExpression.ParseMathML. I tried to use it with some wellformed MathML code, but it always return undefined. What is the matter? Is something wrong in what I do?

Here is an example of MathML code I used
<math display="block"> <mrow> <munderover> <mo>&#x2211;<!-- ∑ --></mo> <mrow> <mi>n</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi mathvariant="normal">&#x221E;<!-- ∞ --></mi> </munderover> </mrow> <mrow> <mfrac> <mn>1</mn> <msup> <mi>n</mi> <mn>2</mn> </msup> </mfrac> </mrow> <mo>=</mo> <mrow> <mfrac> <msup> <mi>&#x03C0;<!-- π --></mi> <mn>2</mn> </msup> <mn>6</mn> </mfrac> </mrow> </math>

Thanks in advance for any help.

For now abilities of Math.Net Symbolics pretty limited. May I ask what are you trying to do?

I'm not familiar with MathML language, so may you add some examples of input, which you want to parse, in naive or latex format?

I have a client side tool that can handle either latex or mathml syntax to represent math functions. Therefore I need to handle such functions in the backend: recognize them, recognize variables and finally evaluate them.

Latex syntax would be better but mathml would be ok.

Any kind of functions should be available to the user that can write them and then save them as template.

Indeed, the problem in this particular case is that we don't even support series yet, nor the concept of locally-scoped symbols (the n in this case, which could be unrelated to an n outside of the series).

Technically we could easily support them in the new visual expressions only, but supporting them in the (semantic) expressions will need some thoughts on design.

Ok thank you for the answer. May I ask you the list of allowed mathml tags I can use in order to be parsed?