Back

Yomichan (JP dictionary for Chrome/Firefox + EPWING + auto flashcards)

(2017-02-08, 1:28 am)FooSoft Wrote: Thanks for the report, quazza. I fixed the issue with {glossary} on Kanji cards and deployed a new release. The problem with {url} is going to be a little more involved to fix, so that will have to wait for the next version.

The other new thing in this version: support for (properly) looking up definitions in textboxes and input fields!

New release seems to be breaking some text input fields for me. Jisho's homepage was fine, but search pages are doing weird things.
http://jisho.org/search/%E9%9D%A2%E5%80%...5%E3%81%84
Same here:
https://www.japanesepod101.com/japanese-dictionary/

Had to disable the extension to get this form to submit. I have auto-search enable (so i'm not holding shift) fyi.
Edited: 2017-02-08, 2:10 am
Reply
The new "Yomichan updated" error message is perfect, because the information appears exactly when and where it's relevant.
Reply
(2017-02-08, 2:09 am)xtreme1 Wrote:
(2017-02-08, 1:28 am)FooSoft Wrote: Thanks for the report, quazza. I fixed the issue with {glossary} on Kanji cards and deployed a new release. The problem with {url} is going to be a little more involved to fix, so that will have to wait for the next version.

The other new thing in this version: support for (properly) looking up definitions in textboxes and input fields!

New release seems to be breaking some text input fields for me. Jisho's homepage was fine, but search pages are doing weird things.
http://jisho.org/search/%E9%9D%A2%E5%80%...5%E3%81%84
Same here:
https://www.japanesepod101.com/japanese-dictionary/

Had to disable the extension to get this form to submit. I have auto-search enable (so i'm not holding shift) fyi.

I'll check this out later, for now I just added a checkbox to disable scanning on text form elements.
Reply
JapanesePod101
(2017-02-07, 1:10 am)FooSoft Wrote:
(2017-02-07, 12:49 am)xtreme1 Wrote:
(2017-02-07, 12:03 am)FooSoft Wrote:
(2017-02-06, 11:11 pm)xtreme1 Wrote:
(2017-02-05, 7:43 pm)FooSoft Wrote: I've just uploaded a new version that addresses this issue. You will get that error once more (because your old tabs are running the previous version), but not after that. From now on you will see this (friendly error message shown in definition popup window):


 [Image: dILG0V3l.png]

Nice that should be better. But what about using a Chrome notification for notifications like this?

Less visibility, plus you won't know which tabs are effected.
All tabs are affected if the plugin is enabled, so what do you mean you won't know which tabs are effected? The whole point of notifications is to be noticed, so that's not really an issue is it? Plus it puts control back on the user to allow or ignore the message.

You are incorrect, not all tabs are effected. New tabs created after the extension was updated work properly, old ones do not. It is easy to imagine a situation where a user has plenty of tabs open, some of them new, some are old. Therefore it makes little sense to display this is a global event, when it is really localized to a subset of tabs. If a person doesn't even use Yomichan in a tab, they shouldn't even care that it will not be usable until the page reloads.

Users ignoring notifications, skipping docs, etc. is a huge problem for devs. Unfortunately, people oftentimes don't care (or don't have attention span) to do figure out what is happening, and it costs me troubleshooting time. Nothing I make will ever fail silently (or even have the option of failing silently). The alert spam was a degenerate case, but a non-modal popup that triggers in place of the definition window when the user scans text *forces* them to acknowledge the issue.
Yeah you are right, I appreciate the explanation of your thoughts on that. I'm still wondering if we can improve the UX more. The box right now is really large for what essentially is `Yomichan Updated: Refresh`.  Any thoughts on resizing the failure box? I get the same feeling looking at is, as when I get failed audio from japanesepod101 and they have the 20s spiel: "the audio for this clip could not be found. It will be recorded and uploaded shortly. Thank you for your patience." When a simple "no audio" would get the message across just as well.

On a similar note, I hadn't really had an issue with it but some folks here made some good points: https://www.reddit.com/r/LearnJapanese/c..._rikaikun/
The box size for lookups is significantly larger than rikai, and gives significantly less information, eg rikai shows 3 definitions without scrolling while yomi shows 1.5~. Any thoughts on reducing font-size and popup size? Users could always manually style it with an external plugin, but it does seem like the size and spacing could be reduced while still being elegant.
Reply
Quote:Yeah you are right, I appreciate the explanation of your thoughts on that. I'm still wondering if we can improve the UX more. The box right now is really large for what essentially is `Yomichan Updated: Refresh`.  Any thoughts on resizing the failure box? I get the same feeling looking at is, as when I get failed audio from japanesepod101 and they have the 20s spiel: "the audio for this clip could not be found. It will be recorded and uploaded shortly. Thank you for your patience." When a simple "no audio" would get the message across just as well.

On a similar note, I hadn't really had an issue with it but some folks here made some good points: https://www.reddit.com/r/LearnJapanese/c..._rikaikun/
The box size for lookups is significantly larger than rikai, and gives significantly less information, eg rikai shows 3 definitions without scrolling while yomi shows 1.5~. Any thoughts on reducing font-size and popup size? Users could always manually style it with an external plugin, but it does seem like the size and spacing could be reduced while still being elegant.

There are always ways to improve the user experience; the question is exactly what can be considered to be considered as an improvement. The failure box is shown using the same IFRAME that is used to render definitions. This FRAME is re-sizable, so you can make it be as big or small as you want. It can also be dismissed by clicking anywhere. You see it when only you are telling Yomichan to look up definitions; from my point of view, it should be obvious as to why some feature is (or is not) working. I know you mentioned that you don't hold down the shift key when scanning for definitions -- this feature is problematic and causes a lot of headache, and I actually kind of regret implementing it in retrospect.

As far as comparisons with Rikai[kun/gu/whatever] go, I reject them entirely. These extensions based on the same old and crusty code (seriously, look at Rikaikun sometime, do it) which was hacked to run on Chrome with a lot of the broken Firefox garbage still in the scripts. The non-interactive, cramped UI was maybe useful when people were still running on resolutions of 1024x768, but not today. Just like I don't care about users who run old versions of Chrome, I also don't care about users who are trying to view webpages on their IoT toaster. As far as I am concerned, 1080p is a *minimum* requirement for a decent experience. I can get several definitions to show up in a non-maximized window without any problem, and in the rare case that I have to scroll the window to view more it is not the end of the world.  I personally absolutely love white space in UI, as it gives me a chance to "breathe" and focus on the information that is presented to me. Sometimes less is more.

If people want a more Rikaikun-like experience, they should by all means use those extensions. I did not start this project with completely new, beautiful ES6 code just to clone an existing tool. Just think about it -- the fact that I had enough motivation to dump hundreds of my precious hours (that I could have spent studying Japanese) into making Yomichan should give people a general idea of what just I think about those extensions, their decisions, and code quality. The "don't hold shift" to search thing may have been a mistake on my part in shoehorning a square peg into a round hole. Honestly, the most important thing I learned about making successful open source projects over the past couple of years is that no matter what you do, there will be whiners. One has to have an uncompromising vision for their work. I am of course open to discussion and high-quality pull requests on GitHub (preferably in that order). 

Regarding the audio thing, I agree, the 20s clip of "not available, will be added shortly, blah blah" is annoying. As I mentioned before though, it is impossible to know what terms have audio associated with them and which do not. You build a URL based on a term's reading and Kanji, and you use it to download and play an MP3 file. Sometimes that file will have Japanese audio, sometimes it will be that "not available" spam. The best thing that might be possible (I don't know if you can do this in the browser with JavaScript) is to not play *any* audio or play a custom beep or something when the user hits play on a term that doesn't have audio associated with it on JPOD101.
Edited: 2017-02-08, 4:03 pm
Reply
(2017-02-08, 3:52 pm)FooSoft Wrote: The best thing that might be possible (I don't know if you can do this in the browser with JavaScript) is to not play *any* audio or play a custom beep or something when the user hits play on a term that doesn't have audio associated with it on JPOD101.
A short custom sound would be great if it's possible.
Reply
(2017-02-08, 3:52 pm)FooSoft Wrote:
Quote:Yeah you are right, I appreciate the explanation of your thoughts on that. I'm still wondering if we can improve the UX more. The box right now is really large for what essentially is `Yomichan Updated: Refresh`.  Any thoughts on resizing the failure box? I get the same feeling looking at is, as when I get failed audio from japanesepod101 and they have the 20s spiel: "the audio for this clip could not be found. It will be recorded and uploaded shortly. Thank you for your patience." When a simple "no audio" would get the message across just as well.

On a similar note, I hadn't really had an issue with it but some folks here made some good points: https://www.reddit.com/r/LearnJapanese/c..._rikaikun/
The box size for lookups is significantly larger than rikai, and gives significantly less information, eg rikai shows 3 definitions without scrolling while yomi shows 1.5~. Any thoughts on reducing font-size and popup size? Users could always manually style it with an external plugin, but it does seem like the size and spacing could be reduced while still being elegant.

There are always ways to improve the user experience; the question is exactly what can be considered to be considered as an improvement. The failure box is shown using the same IFRAME that is used to render definitions. This FRAME is re-sizable, so you can make it be as big or small as you want. It can also be dismissed by clicking anywhere. You see it when only you are telling Yomichan to look up definitions; from my point of view, it should be obvious as to why some feature is (or is not) working. I know you mentioned that you don't hold down the shift key when scanning for definitions -- this feature is problematic and causes a lot of headache, and I actually kind of regret implementing it in retrospect.

As far as comparisons with Rikai[kun/gu/whatever] go, I reject them entirely. These extensions based on the same old and crusty code (seriously, look at Rikaikun sometime, do it) which was hacked to run on Chrome with a lot of the broken Firefox garbage still in the scripts. The non-interactive, cramped UI was maybe useful when people were still running on resolutions of 1024x768, but not today. Just like I don't care about users who run old versions of Chrome, I also don't care about users who are trying to view webpages on their IoT toaster. As far as I am concerned, 1080p is a *minimum* requirement for a decent experience. I can get several definitions to show up in a non-maximized window without any problem, and in the rare case that I have to scroll the window to view more it is not the end of the world.  I personally absolutely love white space in UI, as it gives me a chance to "breathe" and focus on the information that is presented to me. Sometimes less is more.

If people want a more Rikaikun-like experience, they should by all means use those extensions. I did not start this project with completely new, beautiful ES6 code just to clone an existing tool. Just think about it -- the fact that I had enough motivation to dump hundreds of my precious hours (that I could have spent studying Japanese) into making Yomichan should give people a general idea of what just I think about those extensions, their decisions, and code quality. The "don't hold shift" to search thing may have been a mistake on my part in shoehorning a square peg into a round hole. Honestly, the most important thing I learned about making successful open source projects over the past couple of years is that no matter what you do, there will be whiners. One has to have an uncompromising vision for their work. I am of course open to discussion and high-quality pull requests on GitHub (preferably in that order). 

Regarding the audio thing, I agree, the 20s clip of "not available, will be added shortly, blah blah" is annoying. As I mentioned before though, it is impossible to know what terms have audio associated with them and which do not. You build a URL based on a term's reading and Kanji, and you use it to download and play an MP3 file. Sometimes that file will have Japanese audio, sometimes it will be that "not available" spam. The best thing that might be possible (I don't know if you can do this in the browser with JavaScript) is to not play *any* audio or play a custom beep or something when the user hits play on a term that doesn't have audio associated with it on JPOD101.

Sorry, are you saying there's no way to know when to play a custom no audio clip? 

I want to be clear I wasn't advocating for making a rikai 5.0, just that the current popup seems unweildy to some(whiners, as you embracingly say Wink). Maybe I'll try my hand at some css and post them instead of saying,  "hey make it better". 

As for the autoscan, i get it's more troublesome, but it also opens up its use to tablet users, so I know I appreciate the feature. Thanks for thehard work on this. It really is fantastic.
Edited: 2017-02-08, 8:16 pm
Reply
Quote:Sorry, are you saying there's no way to know when to play a custom no audio clip?

I know the MD5 sum of the spam MP3 file (7e2c2f954ef6051373ba916f000168dc), and AnkiConnect checks for this constant to make sure that the spam audio is not added to newly created flash cards. The thing that I will have to investigate is if it is possible to download a remote resource and compute and MD5 sum for it in JavaScript. I would probably have to do this right before I try to play the audio, just to keep the number of HTTP requests to JPOD101 down to a reasonable limit. I don't think they would be happy if everytime somebody looked up definitions in Yomichan, it would issue dozens (potentially hundreds) of requests against their file server.

Code:
Maybe I'll try my hand at some css and post them instead of saying,  "hey make it better".
Give it a shot if you've got the time. My styling is based on a minimal subset of Bootstrap. The templates/styling that irritates me the most right now is the Kanji page. I think it looks pretty terrible in terms of visual balance, but I haven't come up with anything better yet :\
Reply
(2017-02-08, 8:49 pm)FooSoft Wrote:
Quote:Sorry, are you saying there's no way to know when to play a custom no audio clip?

I know the MD5 sum of the spam MP3 file (7e2c2f954ef6051373ba916f000168dc), and AnkiConnect checks for this constant to make sure that the spam audio is not added to newly created flash cards. The thing that I will have to investigate is if it is possible to download a remote resource and compute and MD5 sum for it in JavaScript. I would probably have to do this right before I try to play the audio, just to keep the number of HTTP requests to JPOD101 down to a reasonable limit. I don't think they would be happy if everytime somebody looked up definitions in Yomichan, it would issue dozens (potentially hundreds) of requests against their file server.

Code:
Maybe I'll try my hand at some css and post them instead of saying,  "hey make it better".
Give it a shot if you've got the time. My styling is based on a minimal subset of Bootstrap. The templates/styling that irritates me the most right now is the Kanji page. I think it looks pretty terrible in terms of visual balance, but I haven't come up with anything better yet :\
I've used blueimp's md5 module for browser md5s before and it's pretty nice and quick. Granted another module (albeit a simple , light and fast one) and I've never done it on whatever the mime type for mp3 or whatever jpod is sending your way. 

And for the CSS, will-do, I've used Stylebot to do something similar in the past, that way anyone can download and try whatever someone makes. It's just important to have things with distinguishable css selectors in order to do second-hand styles that I could share. I'll post back here when I get to it.

Side-question: Trying to use the daijirin dict, it hits every letter of the english alphabet and gives things like:
s
三省堂 スーパー大辞林
s 〖second〗
時間の単位,秒を表す記号。

Is it desired behavior to have it including things like two letter chemical compounds and single letter entries like this? I'm not sure what you would do to fix it, besides putting a min char length on entries for that dictionary, but I'm guessing you'd be (probably rightfully) hesitant to do a one-off thing like that.
Edited: 2017-02-08, 10:13 pm
Reply
Thanks for the heads up on the MD5 lib, I'll check it out. 

Regarding 大辞林, yeah there's a bunch of crap in there of questionable usefulness. You can run zero-epwing (distributed with yomichan-import) and see what kind of data I have to work with. I was initially thinking of creating a rule that optionally ignores all entries that do not have a Japanese heading, but decided to error on the side of just letting the user import everything. Something like this would definitely be handled inside of yomichan-import and not the browser extension itself.
Reply
Just released a new version with the requested placeholder audio blocking feature. It was impossible to compute the MD5 hash of the JPOD101 mp3 file without downloading it twice, so I just based the detection on audio clip length (it is 5.694694 seconds). With that amount of precision we can be pretty sure that legitimate audio will not be blocked. Now, instead of hearing that whole comment about the audio clip being added, you will just hear a short click sound.
Edited: 2017-02-11, 3:20 pm
Reply
I have just figured out the way to get AnkiConnect working properly on Mac OS X (even if it is running in the background). Please see https://foosoft.net/projects/anki-connect/ for details.
Edited: 2017-02-11, 7:46 pm
Reply
Awesome news, thank you! I will try that.
Reply
Nice solution for the bad audio, pretty clever. I love the no audio clip.

My settings got partially erased again with the update. Can anything be done about that? I think you mentioned it shouldn't be erasing them, but it keeps happening. Only the anki connect model got erased. So it still remembered what my dictionaries were and which I have enabled.

Also the text/dropdown is a little narrow, so I can't see what I have typed in. Only slightly a nuisance for complex situations like my reading field where I use the standard anki furigana syntax: {expression}[{reading}]
Edited: 2017-02-13, 1:51 am
Reply
Hmm, there were no options changes in this update. Don't know why your model name would be getting messed up...
Reply
Hi there FooSoft and various testers

Thank you for your several years of development and debug work on Yomichan.

I only started using chrome this past couple of days after several years of using firefox and various incarnations of rikaichan/kun/sama over those years.  For me I think the single best thing that yomichan does that absolutely hands down, trumps rikaisama is the gating of the scan function by requiring the SHIFT key to be held down as you mouse over the text. The frustration that I would experience with accidental deletion of text due to automated selection by rikaisama was so annoying that I had dedicated a programmable mouse button to make it easy for me to quickly disable rikaisama before I would start typing and just as quickly re-enable it for proof reading and/or browsing.

 I prefer the yomichan default approach so much more.

It will come as no surprise that I now have a spare mouse button programmed with the SHIFT key.

Having said that I do still occasionally run into a situation where I've used the shift key to type some punctuation character and perhaps before I release shift some unintended selection has been made. I am experimenting with options for "select matched text", "scan delay" and "scan length" to see if I can reduce the occurrence of these (already dramatically less frequent) accidents. 
Is the choice of shift as the hotkey carved in stone or might that someday become a user-specified key?

I do miss ready-access to the Sanseido j-j dictionary definitions but have yet to explore installing EPWING j-j dictionaries for Yomichan.

Sincere kudos!


Google Hangouts and Yomichan

I use yomichan with google hangouts. 
I mention this here in case another user has found a better solution than I have. I am running 
  • Windows 10 Home v1607 (64-bit)
  • Google Hangouts 2017.110.418.3  (the so-called desktop app)
  • Chrome 56.0.2924.87 (64-bit)
    Yomichan 1.0.13
    Google Hangouts 2017.110.418.2 (the browser extension)

    If you are scratching your head over the version difference between the google hangouts desktop app and the hangouts browser extension then, well, so am I.
    They look very much like the same beast to me. The browser extension launches a window separate from the chrome browser. The desktop app launches a windows separate from the chrome browser. If that window has already been launched by the alternate method then it simply grabs focus. The advertised virtue of the so-called desktop app is that you don't need to have a chrome browser instance running however, as you will see from the Task Manager reports below, the chrome.exe process becomes the parent process in both cases!
All is perfectly fine when a google hangout is launched from a gmail tab within the chrome browser ... even after I pop that chat window out into it's own separate window. So no surprises - Yomichan behaviour is as advertised. I guess you might say that the extension's scope extends to that pop-out window.

I am also trying out the so-called desktop version of google hangouts :  
(https://chrome.google.com/webstore/detai...golnpehhpl
and discovered that yomichan is not active or not enabled within that window. 

This is a bit of a surprise because task manager shows this desktop hangout process as one of three sub-processes to the parent "Google Chrome" process. (C:\Program Files (x86)\Google\Chrome\Application\chrome.exe)
Inspecting the three windows using AutoIt3 Window Spy (aka AutoHotkey) I learn that each of the three windows 
  1. the desktop hangout window and 
  2. the pop-out window from a gmail tab within the chrome browser and
  3. the chrome browser window itself
are identified as the same ahk_class "Chrome_WidgetWin_1"

I can only imagine that this is because the scope of the Yomichan (as a chrome browser extension) is not embracing this alternative window for using hangouts. If anyone reading this is successfully using google hangouts independent of gmail and knows how to get yomichan functioning within that chat window then please share. (As I will if and when I solve the problem for myself.)
It is early days for me yet and it is not really a big deal because a satisfactory working solution exists (via a gmail tab) and I may yet find myself completely won over to chrome in the near future.

cheers!
Reply
Thanks for the kind words, najevi. Sometimes it's scary to realize that I've been working on Yomichan (in its various iterations) for so many years now... time flies fast.

Regarding Yomichan activating when you press the shift key -- this will only happen if you move the mouse while the key is held down. This used to not be the case, and the definitions window would be unintentionally shown when you are typing in textboxes, or whatever. I was annoyed by this behavior so that the shift key by itself should not trigger definitions; mouse motion is required. I keep meaning to add options to allow users to choose which key they use as the modifier for scanning; I imagine that if you were able to pick ctrl or alt, you would not have any more problems.

About the Hangouts thing -- the "apps" are not web pages and as such would not have Yomichan code injected into them. They do look similar and are both rendered by Chrome though. Regardless, Google is killing off support for the standalone applications (you can no longer upload new apps, and eventually existing apps will stop functioning), so this problem will resolve itself ; )

You should check out EPWING support too, it's pretty easy to get things up and running. I currently only support Daijirin and Daijisen dictionaries but I am adding support for more when I have time (it's just a matter of writing regular expressions to parse out useful information). I will have to see if I have Sanseido laying around here anywhere though...
Reply
(2017-02-11, 3:20 pm)FooSoft Wrote: Just released a new version with the requested placeholder audio blocking feature. It was impossible to compute the MD5 hash of the JPOD101 mp3 file without downloading it twice, so I just based the detection on audio clip length (it is 5.694694 seconds). With that amount of precision we can be pretty sure that legitimate audio will not be blocked. Now, instead of hearing that whole comment about the audio clip being added, you will just hear a short click sound.
Thanks, that helps a lot!
Reply
Thanks entirely to fellow forum member flamerokz, yomichan-import now has support for 明鏡国語辞典 EPWING dictionaries!
Reply
Hi, Yomichan seems to not be finding the audio for kana-only words (I don't think this is new). I noticed ほっと today because I only add cards with audio and it was already in my deck. Seems I had an audio card from a pre-Yomichan card-generation method. Curiously, the audio doesn't appear on WWWJDIC either, but it's there in the sound files:

http://assets.languagepod101.com/diction...3%E3%81%A8
http://assets.languagepod101.com/diction...3%E3%81%A8
Edited: 2017-02-18, 6:55 am
Reply
(2017-02-18, 6:51 am)HelenF Wrote: Hi, Yomichan seems to not be finding the audio for kana-only words (I don't think this is new). I noticed ほっと today because I only add cards with audio and it was already in my deck. Seems I had an audio card from a pre-Yomichan card-generation method. Curiously, the audio doesn't appear on WWWJDIC either, but it's there in the sound files:

http://assets.languagepod101.com/diction...3%E3%81%A8
http://assets.languagepod101.com/diction...3%E3%81%A8

I see exactly what's going on here:

Code:
        let url = `https://assets.languagepod101.com/dictionary/japanese/audiomp3.php?kanji=${encodeURIComponent(definition.expression)}`;
        if (definition.reading) {
            url += `&kana=${encodeURIComponent(definition.reading)}`;
        }

Yomichan assumes that "expression" is always Kanji. Should be easy to fix.
Reply
I've run across cases where Yomichan doesn't retrieve all the relevant glosses for a word. For example:

Quote:1) 押さえる = to have a good grasp/understanding of something.
2) おさえておきたい言語 = A language one would like to achieve a good grasp of (to be ready/able to become an interpreter in North America).

Yomichan picks up the full range of definitions for 押さえる, but not for おさえて (despite 押さえる appearing in the lookup box for おさえて). Only the first gloss group appears for おさえて. Any idea what might be happening here?
Edited: 2017-02-18, 5:16 pm
Reply
That's because in the second case it is only showing senses for 押さえる which are tagged as v1 (ichidan verb). When you are looking at the plain form of the term, it makes sense to list all possible definitions; however, when displaying a deinflected verb the grammar tags have to match with with the deinflection rules applied. 

I don't know what is happening with this case -- it is possible I'm misinterpreting the intent of EDICT grammar tags (like the first sense's tags apply to subsequent tags), or maybe this term was just mis-tagged in the dictionary.
Edited: 2017-02-18, 8:51 pm
Reply
I just discovered rikaichan and love it, thanks a lot.
Reply
(2017-02-18, 7:22 pm)deignouze Wrote: I just discovered rikaichan and love it, thanks a lot.

lol?
Reply