DSpellCheck icon indicating copy to clipboard operation
DSpellCheck copied to clipboard

Display "wrong english" as an error

Open maurymarkowitz opened this issue 5 years ago • 4 comments

I write (a LOT) in both UK and US (and Canadian) English. DSpellCheck has options for UK and US, and "both". However, if you select the both option, using the wrong one in a particular article is no longer flagged as an error - and it should be.

Is there any possibility that DSpell could look for the instances of the different spellings and decide which of the two languages is being used in a particular document, and then indicate uses of the "other" as an error?

maurymarkowitz avatar May 22 '19 18:05 maurymarkowitz

Sorry for late reply. It's not exactly an easy task to decide which language should be used for a file especially if they are so close as different variants of English. Possible options:

  1. Do it based on filename in a way configurable by user seems to be option which will hardly be used by anyone because it's complex to set up and seems to be too specific.
  2. Select based on document's content (e.g. which has the least errors in one of the languages). Sounds like a nice possibility but it's not entirely clear in which moment it should be done. For example opening new document would make the algorithm confused and it has to readjust after some text is inserted probably. Also checking the whole document for each new opened one is very bad for performance but checking only some part (e.g. visible) may not be enough for correct language selection.
  3. I could also add a manual action to change language based on file contents but I'm not sure if it will be convenient even for your use-case.

So basically I don't know what would be the straightforward way to implement such feature even experimentally currently, if you have some idea please let me know.

Predelnik avatar May 27 '19 13:05 Predelnik

Personally I would like (2) with no conversion after the initial open. If the user has selected (say) UK english as their default, I think it would be entirely natural for them to expect it to be in that mode. In contrast, if they open an existing file, and it's "clearly" in US english (be that what it may) then switching to US would be useful.

A data point: the last two major edits I worked on were the Type 271 radar in UK and JOSS programming language in US. This is my typical pattern. I suspect people in the US use only US, but I suspect those in the UK do a lot of switching back and forth like we Hardy Few from the Great White North.

maurymarkowitz avatar Oct 10 '19 18:10 maurymarkowitz

Late suggestion, and I am unsure of the possibility (I haven't looked into it myself), but perhaps a menu option/toggle that is only visible when the "Both" option is selected, with the following options "Both, US only, UK only". Makes it so that it is easily available to the user to switch between at any time. Could perhaps even make it remember the option per tab and/or per file, for user convenience.

Omegano avatar Dec 08 '20 19:12 Omegano

That would be fantastic!

On Dec 8, 2020, at 2:21 PM, Omegano [email protected] wrote:

Late suggestion, and I am unsure of the possibility (I haven't looked into it myself), but perhaps a menu option/toggle that is only visible when the "Both" option is selected, with the following options "Both, US only, UK only". Makes it so that it is easily available to the user to switch between at any time. Could perhaps even make it remember the option per tab and/or per file, for user convenience.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

maurymarkowitz avatar Dec 08 '20 19:12 maurymarkowitz