LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Bodhi (https://www.linuxquestions.org/questions/bodhi-92/)
-   -   Dictionary in Moksha Launcher (https://www.linuxquestions.org/questions/bodhi-92/dictionary-in-moksha-launcher-4175647457/)

the_waiter 02-01-2019 10:43 AM

Dictionary in Moksha Launcher
 
1 Attachment(s)
Hello there

I am not sure I should announce this info on the forum (project in heavy development) but I will because I can see too many troubles on the forum these days. I just wanna make you feel we (devs) are still here and have not only good ideas but also good solutions and good news :)

Let me introduce you a brand new module for Launcher plugin called Launcher Dictionary.

The idea came from my everyday discussion with Robert (Ylee). He brings to life forgotten plugin called Spellchecker which can check your words with utilities like Aspell or Hunspell.
More info here:
https://github.com/rbtylee/launcher-spellchecker

I realized the Launcher code is different than I know from my work on the extra modules so I gave up on any ideas related to that. Then I looked closely to the code and tried some first ideas with sdcv stardict tool. And I succeed. Within a while I had first working code.

The main reason to do this was to have an elegant, fast and usefull feature in moksha for instant words translating. Of course, this code has no ambition to be an Stardict or Goldendict replacement, nevertheless I think it could fulfill some users needs.

More info here:

https://github.com/thewaiter/Evry-Dictionary



Štefan

hemlocktree 02-01-2019 10:56 AM

Thanks stefa.

my opinion:

first since the old forum is gone you get a bunch of people running other distros that want to bash this one or else they are serious about exploring this one. but the others here are more numerous than our old forums. so you will get a ot of let's say stranage feedback and comments at times.


2n - bodhi and e/moksha is so unique it IS weird and tought for gnome/kde/mate people to get into ti. before there was bodhi i had tried to get into enlightenment distros that had no help and a ton of issues and just seeing what you get once downloaded it is rather overwhelming. once i got into bodhi and with some patience and all of the help fo the old regulars i GOT IT and love it and it makes sense. so that initial LOSTNESS is legit esp when you are a neophyte to linux and command line.


and not that you need too much command line at all. but it scares the hell out of people.

also just the setups are so different compared to other linuc desktops and distros - it seems satrange and complicated. but to me that is the most unique thing and maes this different than mac or windoze or other linux windows looking distros.

was going to write more bt have a very sick dog i have to deal with@!

the_waiter 02-01-2019 11:43 AM

@hemlocktree

This my work is for Bodhi/Moksha/E users and I pretty do not care about what other distro users say. Of course when bugs are related, I do care.
Linux world is nice. I like it very much. There are > 800 more or less active distributions and one can take the best for him. I will never persuade anybody to switch to Bodhi at any prize. Bodhi is pretty tiny community and as you said Moksha or E is not for everyone. We all know this fact.
On the other hand, this forum has many other distro users which can look on this section and try our distro. And maybe one day some of them will became a team member.

But I think this words are little bit off topic

I would like to see some module feedback ;)

S

hemlocktree 02-01-2019 11:53 AM

sorry stefan but i think you know what i mean...

rbtylee 02-03-2019 05:24 AM

Quote:

Originally Posted by the_waiter (Post 5956469)
Hello there

I am not sure I should announce this info on the forum (project in heavy development) but I will because I can see too many troubles on the forum these days. I just wanna make you feel we (devs) are still here and have not only good ideas but also good solutions and good news :)
...

Of course, we at least Štefan and I are always doing something. And both of us are full of ideas on how to improve Bodhi, Moksha, or the apps we use.

Quote:

Originally Posted by the_waiter (Post 5956469)
...

The idea came from my everyday discussion with Robert (Ylee). He brings to life forgotten plugin called Spellchecker which can check your words with utilities like Aspell or Hunspell.
More info here:
https://github.com/rbtylee/launcher-spellchecker ...

And this is something I have been doing sorta on the side. It is perhaps unknown to many recent Bodhi Users but our Quick Launcher, which used to be called Run Everything in e17 (and still is in e22), originally had a number of plugins. These plugins extended the functionality of Run Everything. So my project on the side was to add the ones that we used to have back. At least the ones that were easily fixable. Make some minor changes so they would compile or compile 'better', and fit in more with Moksha as it is now. As well as perhaps create a few new ones.

Quote:

Originally Posted by the_waiter (Post 5956469)
..
I realized the Launcher code is different than I know from my work on the extra modules so I gave up on any ideas related to that. ..

Well yes, these modules are plugins not the sorta module one finds in our Moksha-modules-extra repo. Neither Štefan nor I had did anything with everything plugins prior to this. BUT the API is rather simple to understand, if as is usually the case in e-programming stuff, UNDOCUMENTED. The source code is the documentation.

The irony here is Štefan announcing this dictionary plugin before I even officially announced my work on the launcher-spellchecker. As he told me his announcement here is sort of a teaser, an inside look at what is coming.

Quote:

Originally Posted by the_waiter (Post 5956469)
..

Then I looked closely to the code and tried some first ideas with sdcv stardict tool. And I succeed. Within a while I had first working code.

The main reason to do this was to have an elegant, fast and usefull feature in moksha for instant words translating ...

Shortly after I showed Štefan my work on the launcher-spellchecker, he wondered about added support for the sdcv stardict command. I thought perhaps he was going to add an option to the spellchecker module itself. But I suppose he found it simpler to create a separate module. Makes sense as I don't know if it is possible to have two different triggers in the same everything plugin. And having only one trigger would mean switching the command used in the module settings if you wish to switching from spellchecker mode to dictionary mode.

Regardless, as it currently is, the code for the two modules is more or less the same, except for minor differences in parsing command output.

Quote:

Originally Posted by the_waiter (Post 5956469)
..
Of course, this code has no ambition to be an Stardict or Goldendict replacement, nevertheless I think it could fulfill some users needs.

More info here:

https://github.com/thewaiter/Evry-Dictionary

Good work on this, Štefan. This is sort of a beta release. My next comment will look at the module more closely.

rbtylee 02-03-2019 06:36 AM

1 Attachment(s)
Ok the module is currently under development and so far Štefans work. Once completed to our satisfaction I will try to package it and add it to Bodhi's repo.

My thoughts on what we currently have:

The instructions on github could be a little clearer for beginners:

Quote:

This module depends on sdcv utility. It is a console Stardict application.

sdcv installing: sudo apt-get install sdcv

Unpack downloaded dicts and copy to /usr/share/stardict/dict directory
At least the mistake fixed. copy to /usr/share/stardict/dict should be copy to /usr/share/stardict/dic

That one got me I Installed the module and sdcv, made the directory /usr/share/stardict/dict copied a dictionary over and sdvc could not find it. So the plugin was not working :(

Not a big deal as
Code:

man sdcv
told me all I need to know and i fixed it. But would the average user think of this and get this working. Judging from forum posts at least some would not.

Perhaps we could add a fool proof example such as for the Merriam-Webster's Collegiate:

Code:

sudo mkdir -p  /usr/share/stardict/dic
wget http://downloads.sourceforge.net/xdxf/stardict-comn_dls03_mwc-2.4.2.tar.bz2
sudo tar -xvjf stardict-comn_dls03_mwc-2.4.2.tar.bz2  -C /usr/share/stardict/dic

Of course, flesh this up some.

And perhaps briefly mention using STARDICT_DATA_DIR which can be used to set another location for dictionaries other than a system location. (perhaps .local/share/stardict/dic)

Quote:

Originally Posted by the_waiter (Post 5956469)
..
The main reason to do this was to have an elegant, fast and usefull feature in moksha for instant words translating. Of course, this code has no ambition to be an Stardict or Goldendict replacement, nevertheless I think it could fulfill some users needs.

Well I am not bilingual, desite remembering a little french I had in high school decades ago and knowing a touch of spanish from working around Latinos. So using this for translating a word or two would not be very useful. What I would use it for is as a dictionary, to find out the meaning of some word I didn't know or saw used in a unfamiliar manner. That is why in the example above I used an well known American English dictionary.

And here the module needs some work:

Attachment 29694

We need to strip/replace the HTML stuff, for example ' in Merriam-Webster's Collegiate it should be Merriam-Webster's Collegiate

Second, Is there any way to not have icons on each line, they add nothing. Unsure if this is possible as everything is currently coded.

Third, I can't read the full definition on each line, i have to copy it to the clipboard and then paste somewhere to see it in full. This is a serious usability issue. Is this even possible?

And then there is other issues: What happens if the user has set SDCV_PAGER perhaps SDCV_PAGER=leafpad? Try it.

And should we warn if sdcv is not installed or there are no dictionaries? The same thing goes for my spellchecker plugin.

Plus I know you are working on another feature to add, so I will not mention that.

And the last issue is the all these dictionaries listed in your link. What is the copyright on these? Is there any that we can add to our repo? At least and english one or two. It would be nice if when I make a deb file for this it installs not only sdcv but a dictionary so that it works for at least english out of the box, or has a few dictionaries added to the Recommends in the deb file.

And one more minor issue can we rename the github repo to launcher-dictionary to be more consistent with the other plugins I am planning to add?

Also a question what does engine command do in the settings? Is this what you are working on?

hemlocktree 02-03-2019 06:43 AM

thanks robert - gives me a bit of insight as to what to do... have to dumb everything down in my case - sorry to say.

the_waiter 02-03-2019 08:15 AM

Thanx Robert for comments and suggestions. Yes, this is just a beta if not alpha release. Lots of work in front of me...but maybe I was too excited to share this project with users :)


All times are GMT -5. The time now is 07:01 AM.