On Fri, Mar 9, 2012 at 6:13 AM, Bharath M R <catchmrbhar...@gmail.com> wrote:
>
>
> On Thursday, March 8, 2012 10:55:34 PM UTC+5:30, Aaron Meurer wrote:
>>
>> This looks like a good start.  Did you think about ways that some of
>> these ideas can be used in SymPy Live too?
>>
>> On Thu, Mar 8, 2012 at 9:55 AM, Bharath M R <catchmrbhar...@gmail.com>
>> wrote:
>> > Hi,
>> > I am Bharath M R, a student of Electrical Engineering at IIT Madras.
>> > I would like to apply for the building the gamma.sympy.org site. I would
>> > like to
>> > implement the following things as part of the project.
>> >
>> > 1)Basic parsing
>> > Something like solve x**2==1, integrate x**2 will be parsed and
>> > interpreted.
>> > Doing something like wolphram alpha would require a lot of ideas from
>> > natural language processing which I am not familiar with.
>>
>> This is something that can be improved upon over time.  The important
>> thing here is to start with a good framework in SymPy to build upon,
>> so we can easily extend it with new rules.
>>
>> And no matter how much you implement, it will always be a heuristic.
>> We just want it to catch the common case.  We can do things like
>> provide a feedback button for mis-interpreted input, so we can get an
>> idea of what doesn't work and where things need to be improved the
>> most.
>
> Yeah. I am going through the Match functions in the codebase and I should be
> able to figure out a way.

What we have now is very limited, and the way that it's done will not
work.  We have two kinds of parsers in SymPy right now.  There's
sympify(), which parses an expression in Python grammar and converts
unknown variables into Symbols, literals into corresponding SymPy
types (like 1 to Integer(1)) and operations into corresponding SymPy
operations (like 1/2 to Rational(1, 2)).  This only works with
expressions in Python notation (we allow ^ for exponentiation, but
that only works by replacing all instances of ^ with ** before doing
any parsing).

Then we have some very limited parsers for things like mathematica and
maxima.  These are almost completely useless.  Aside from not really
implementing very much, the problem is that they use regular
expressions.  But regular expressions do not work for parsing, because
the expressions that we are parsing are in a higher grammar.  Namely,
it's impossible to do things like parenthesis matching with regular
expressions.

What is really needed is a parser, that goes through an expression,
and builds a syntax tree out of it.  What you need to do is build
something that is modular enough that you can easily plug in new rules
to it (like "integrate expr dx" => integrate(expr, x), or "x y" ->
x*y).

By the way, on a slightly related note, here are some other things to
think about doing as far as heuristics go. First, automatic spelling
correction, so if I type "intergate x^2 dx", it gives me automatically
"integrate(x**2, x) == x**3/3", with a message saying "did you mean
"integrate x^2 dx" with "integrate" underlined (like happens when you
do a Google search).  Second, automatic correction of mismatched
parentheses, so if I type "sin(x*(x + 1)", it automatically guesses
that I meant "sin(x*(x + 1))" (WolframAlpha does this).  Obviously,
these would both be limited functionality, and are not required for
the project, but they would be neat and useful to have.

>>
>> >
>> > 2) An incremental search for functions in symPy
>> > Its very important for a person to get to know the particular function
>> > he
>> > wants to use. This will be implemented using ajax calls to the sphinx
>> > documentation database.This will be similar to search in scilab /
>> > mathematica.
>>
>> Additionally, there should be links throughout the interface to the
>> relevant Sphinx documentation for the various functions used (similar
>> to in WolframAlpha).
>>
>> >
>> > 3) A lyx/ Mathematica styled input.
>> > This greedily converts the expressions into latex symbols, so that the
>> > user
>> > knows what he is actually computing. We can also add a set of symbols
>> > for
>> > summation, integrals, differentiation as a bottom bar. The input will
>> > look
>> > like latex input to the user, while we convert the expressions into
>> > required
>> > symPy functions in the backend.
>>
>> How did you plan to implement this?  For now, the way that I know to
>> do it is to first compute the whole expression to SymPy, then call
>> latex() on it, and parse the latex with MathJax.  That is what happens
>> at SymPy Live.  It sounds like you want something that lets you type
>> LaTeX styled math on the fly, which basically amounts to an equation
>> editor.
>
> I was thinking something like http://www.texrendr.com/.
>>
>> >
>> > 4)Matplotlib for plotting
>> > We plot the expressions, if it is plottable just as Wolphram Alpha by
>> > default.
>>
>> The app engine now supports numpy, so this should be doable (I hope).
>> Our matplotlib plotting engine is still in its infant stages (for now,
>> it only lives at https://github.com/sympy/sympy/pull/673), but it
>> should grow.  Hopefully we will get another project that will improve
>> it.  You could also spend some time of this project working on it,
>> though obviously it would be better if most of the time were spent
>> doing the other things.
>
>
> Looks like I have to go with svgfig on this. The discussion at
> (http://old.nabble.com/Pure-python-matplotlib-for-Google-App-Engine-td32721389.html )
> says that a lot of c++ code has to be rewritten in python. I can write a
> backend for svgfig.
>>
>> >
>> > 5)Ipython like notebook.
>> > I think it is possible to port the Ipython notebook according to this
>> >
>> > discussion(https://groups.google.com/forum/?fromgroups#!topic/sage-notebook/re2bUt4vCxA).
>> > But the time it takes to port is not very fixed. I want to know whether
>> > I am
>> > overreaching by including it.
>>
>> Even without the notebook, we should use IPython itself in SymPy Live
>> (http://code.google.com/p/sympy/issues/detail?id=2645), if that's
>> possible.  That will give us things like better tab completion and
>> access to IPython magic. My idea is that you should be able to click
>> on a SymPy Gamma calculation and just get a little SymPy Live session,
>> so the two projects are related.
>
> I will figure out whether this is possible.

You could just do what WolframAlpha does.  There, you can't click on
parts of the expression, but there are little links at the bottom for
each of the relevant parts to their docs.

Aaron Meurer

>>
>> >
>> > 5) Make the interface look beautiful with twitter bootstrap.
>>
>> +1.  I don't know anything about this specific library, but a
>> beautiful, highly functional interface is almost as important as good
>> functionality.
>>
>> Aaron Meurer
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/sympy/-/pd5QrgBooY8J.
>
> To post to this group, send email to sympy@googlegroups.com.
> To unsubscribe from this group, send email to
> sympy+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/sympy?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to