RocketChat / Rocket.Chat.Electron

Official OSX, Windows, and Linux Desktop Clients for Rocket.Chat
https://rocket.chat/
MIT License
1.59k stars 704 forks source link

Spellcheck does not return proper corrections #2804

Open inventivestom opened 9 months ago

inventivestom commented 9 months ago

Search before asking

Operating System

Operating System Version

Windows 11 home 64 bit intel i9

It happens on the web browser too?

No, it just happens on the Desktop app

Rocket.Chat Desktop App Version

3.9.11

Rocket.Chat Server Version

6.4

Describe the bug

Spellcheck does not return some of the correct and most obvious corrections. FOr example, when I write "beleive", the proper result is not included in the returned corrections. When I am working in the browser, I get the right results. It seems like the results are being filtered and something is filtering out these obvious results on the desktop app. On the mobile app I have (Android Note 10, RC V 4.44.2) the autocorrect (I use Grammarly keyboard) corrects these mistakes.

image

Another example is "didnt" which is missing the apostrophe. In a browser the top result is the proper word "didn't" but on the RocketChat desktop app, that's not generated in the list.
image

FInally, one last example is the following typo "propbably", which doesnt return probably in the correction list, where the browser does. image

I propbably find at least 4-5 a day and its always the same behavior, the most obvious and correct results are not included in the list at all, basically making the the spell checking useless on at least 30% of the mistakes my team has sees

How to Reproduce

  1. Log into rocketchat desktop app
  2. Start a new message
  3. Enter the word beleive or didnt or propbably
  4. View result list for each one

Describe your Expected behavior

I expect the results to be comparable to other spellcheck functions on the browser of the phone. It seems like the spellchecker is just completely excluding some of the most likely corrections from the list and in many cases, I am only getting like 2 results. There are open source algos that would solve these problems quite simply:

https://medium.com/@agusnavce/a-quick-overview-of-the-implementation-of-a-fast-spelling-correction-algorithm-39a483a81ddc

Anything else

No response

Are you willing to submit a code contribution?

preeesha commented 9 months ago

Hey @inventivestom, thanks for your kind suggestions. That seems like an helpful change to make.

preeesha commented 9 months ago

I am working on this issue. @jeanfbrito I'll be updating you with the progress soon.

Giridharan002 commented 9 months ago

Hi @inventivestom, On the RocketChat desktop app, the spellcheck feature is working fine for me. I've tested it on my end and it seems to be functioning correctly. If you're still experiencing issues, it might be worth trying to update your RocketChat desktop app to the latest version. If the problem persists, could you please provide a video demonstrating the issue? This will greatly assist me in understanding and resolving the problem.

spellcheck

preeesha commented 8 months ago

@jeanfbrito do you allow the use of external spellchecker libraries as they would be beneficial for the overall UX?

jeanfbrito commented 8 months ago

The spellcheck is provided by the Operation System. We would need to see what can be done about it.

preeesha commented 8 months ago

Okay @jeanfbrito

I feel for a better experience we can add more suggestions to the spellchecker just like chrome and chromium does.

After researching on this topic I found that electron also provides a first class support to add custom suggestions to the spellchecker.

We can leverage one of any popular spellchecker libraries to do so.

What do you think about it? Please let me know.

jeanfbrito commented 8 months ago

Of course, can you share your ideas and references? We just cant overload the app, but any improvement is welcome.

preeesha commented 8 months ago

You're right. Using a custom spellchecker library will add bloat of the dictionary of the specific language.

After researching, I found a fairly popular library called electron-spellchecker which rather than using a custom dictionary leverages the dictionary of existing chrome/chromium installation.

Going by its size vs value ratio, I think it's the perfect choice for our use case.

Here's the link: https://www.npmjs.com/package/electron-spellchecker

Please let me know your views.

jeanfbrito commented 8 months ago

Seems like an old and discontinued package. There is any other way to improve what we have today showing more suggestions? I will need to dig on it to see how it works. But as the OS that gives us the suggestions I don't see how to improve it doing better than the OS already does.

On Tue, Feb 6, 2024 at 3:53 PM Prisha Gupta @.***> wrote:

You're right. Using a custom spellchecker library will add bloat of the dictionary of the specific language.

After researching, I found a fairly popular library called electron-spellchecker which rather than using a custom dictionary leverages the dictionary of existing chrome/chromium installation.

Going by its size vs value ratio, I think it's the perfect choice for our use case.

Here's the link: https://www.npmjs.com/package/electron-spellchecker

Please let me know your views.

— Reply to this email directly, view it on GitHub https://github.com/RocketChat/Rocket.Chat.Electron/issues/2804#issuecomment-1930562743, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI7PCU4EQFD3IEZ7AE7YODYSJ33TAVCNFSM6AAAAABBNRTJBOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZQGU3DENZUGM . You are receiving this because you were mentioned.Message ID: @.***>

-- Atenciosamente, Jean Brito.

preeesha commented 8 months ago

@jeanfbrito this is the most updated library of all. After researching more on the topic I found that OS affects the suggestions to a basic level and on top of that chrome uses its own spell checker called enhanced spell checker which is provided by google.

I think this library is the best and the most updated library we can integrate in the our app.

I would really like to have a green or red signal from your side.

Thanks for your time Prisha Gupta

jeanfbrito commented 8 months ago

@preeesha Sorry, we cant add this library as it isn't updated for the last 4 years already.