mathnet / mathnet-symbolics

Math.NET Symbolics
http://symbolics.mathdotnet.com
MIT License
341 stars 66 forks source link

Cannot parse MathML #43

Open narem81 opened 6 years ago

narem81 commented 6 years ago

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 `

n = 1 1 n 2 = π 2 6

`

Thanks in advance for any help.

FoggyFinder commented 6 years ago

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?

narem81 commented 6 years ago

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.

narem81 commented 6 years ago

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

cdrnet commented 6 years ago

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).

cdrnet commented 6 years ago

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.

narem81 commented 6 years ago

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