On Tue, Feb 25, 2014 at 7:51 PM, Aditya Shah <[email protected]> wrote:
> As you have stated previously, the framework need not detect the language
> that it is parsing from and the user provides input regarding that. Now,
> since this is a Mathematica string, we directly specify it to be so. In the
> specification for Mathematica, we define that functions take arguments via [
> ] instead of the normal ( ). Also, we define that the built in functions
> start with a capital letter and so their Sympy equivalent includes
> converting them to lower case. And lastly the information about the inverse
> trignometric function is given telling the framework to drop the 'Arc' and
> add 'a' as a suffix to the function name. As for the framework, once the
> specification is given we can construct a form of Earley parser to parse the
> strings.
>
> So in this case, the flow will be something of the form:
>
> ArcSin[Sqrt[x]] ==> asin(Sqrt[x]) ==> asin(sqrt(x)) (which is the final
> string)

Is this different to what we have already here:

https://github.com/sympy/sympy/blob/master/sympy/parsing/mathematica.py

>
> So actually there would be a module that will generate a parser given a
> specification. The actual parsing takes place using the generated parser.
>
> I think that Sympy needs a proper parsing framework so that it can be
> extended very easily to other languages. I will work on the exact details of
> the specification file (what input should be taken from the user regarding
> the specification of the new language).

I agree that it would be nice to be able to parse general things, e.g.
things like
"plot x^2 from x=1 to 10" and it would work like here:

http://www.wolframalpha.com/input/?i=plot+x%5E2+from+x%3D1+to+10

But I don't know how difficult this is (I don't have much experience
in this field), I suspect this is a huge undertaking.

Ondrej

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CADDwiVBiswSr_mRaok_JwYzkZy%2BPfxGX3nY2NTbjkAeSS2hEUw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to