Bug 166997

Summary: wish : krunner could use libqalculate or google search for evaluating maths
Product: [Plasma] krunner Reporter: Jonathan-David Schröder <myselfhimself>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: wishlist CC: adaptee, anselmolsm, esigra, myselfhimself
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description Jonathan-David Schröder 2008-07-19 13:09:40 UTC
Version:            (using KDE 4.0.83)
Installed from:    Ubuntu Packages
OS:                Linux

Hi,
Krunner's current math expression evaluator isn't very powerful.
for example, log() exists but ln(), pow or ^ and sqrt() don't...

libqalculate developped by the qalculate project allows very nice scientific calculations and could be used for math evaluation. For example =3 hour + 2 seconds is understood by libqalculate..

another possibility is using google's search right away from krunner and show the first result. (this goes further than the math / conversion scopes).

the use of libqalculate and/or google as a backend for evaluating things (which would start with an = sign) could be enabled/disabled in some krunner setup menu.
Comment 1 Aaron J. Seigo 2008-07-19 20:48:43 UTC
> libqalculate

a possibility ..

> using google's search

i'd prefer not to require online access (and a proprietary solution, for that matter) for such a feature.
Comment 2 Jonathan-David Schröder 2009-10-31 00:43:02 UTC
Hello I am not a KDE developer.
Though, I'm bringing the issue/feature request up again because I have more ideas now.

That Alt+F2 <=> Kmenu textfield or a specific plasma widget
could be used for querying just about anything
for now: programs, files, and semantic-desktop-aggregated stuff

to corroborate on the initial request,
now there are websites which provide web APIs for typing stuff and getting an answer.
I've recently found out about Wolfram Alpha exposing a web API: http://www.wolframalpha.com/developers.html
There's likely going to be more and more web services/APIs which take human readable queries as input and output something likely also human readable.

By the way, nepomuk or the semantic desktop framework could use the local computer's data and/or the web's data altogether to answer questions typed the user.

All in all, there should be a ~~KRunnerAnswerFetcher~~ plugin interface for the krunner field which takes an string (starting with "=") as input and callbacking returning HTML data or a simple string. Plugins implementing this interface could be called in the situation where:
- the entry starts with "=" (as currently for Maths formulas)
- and typing has stopped (eg. after 1.5 seconds KeyUp-time)

Maybe I can find students in my engineering school ready to design + implement something as a school project in january.
Please give feedback on the above ideas.

Sincerely,
Jonathan-David Schröder
Comment 3 Jekyll Wu 2011-12-10 17:55:18 UTC
I think the libqalculate support has been there for quite some time. So close this report as FIXED.

http://quickgit.kde.org/index.php?p=kde-workspace.git&a=commit&h=81e45a26aa0b5dd539dd629850baba34eb533c86