Re: Spellcheck and autocorrect events

On Thu, Dec 18, 2014 at 2:16 PM, <chaals@yandex-team.ru> wrote:
>
> Johannes said elsewhere that this topic is worth considering - is it
> possible to get access to spellcheck and autocorrect at some level of
> detail deeper than turning them on or off.
>
> It seems that the first thing to do is write up what you want to do with
> that access, and then figure out what kind of access that implies getting…
>

Purpose:
-- Be able to override right-click menu without losing spellchecking
-- Control autocorrect and spellchecking individually
-- Have direct control over the language used for  spellchecking from
Javascript
-- Have a way to more specifically tell the browser what makes out a
sentence for something it is to spellcheck.  So for example an editor with
a citation plugin may have something like the following:

<div cE=true>
In the book <span cE=false class="citation-title>The World according to
me</span> the sociologist <span cE=false
class="citation-author-as-subject">Émile Durkheim (1902)</span> writes a
great deal about his early childhood.
</div>

It would be good to be able to tell the browser to please spell/grammar
check a sentence such as:  "In the book SOMETITLE the sociologist AUTHOR
writes a great deal about his early childhood." in English. And this is
assuming that some internal spellcheckers may be intelligent enough to try
to guess the meaning of a word in a sentence when spellchecking, which I am
not sure they are.


> An obvious one is knowing that a spellchecker *wants* to correct a word,
> and looking in a custom dictionary. For example in various Yandex services
> we use a russian/english input method, where ghbdtn can actually be
> recognised as привет and цувтуывфн as wednesday. (This saves switching
> keyboards for simple stuff). But my spellchecker doesn't pick that up, so
> it tries to do all kinds of odd and rather annoying things instead.
>

Indeed, custom dictionaries would also make a lot of sense

Possible way to make this possible:
A simple function accessible to Javascript that takes two arguments: text
to be checked and language and which return all the possible suggestions
listed by beginning and end character number of the original string., For
example:

> spellcheck("Who's kat iz dat?",'en_US');

[
  {
    start: 0,
    end: 4,
    suggestions: ["Whose"]
  },
  {
    start: 6,
    end: 8,
    suggestions: ["cat","hat","mat"]
  },
  {
    start: 10,
    end: 11,
    suggestions: ["is"]
  },
  {
    start: 13,
    end: 15,
    suggestions: ["that"]
  },
]


Then Javascript would need to need to be used to do everything else: draw
red lines under corresponding words, create selection menus, etc. .It seems
though that this would be something that should be specified somewhere else
than in contenteditable.


-- 
Johannes Wilm
Fidus Writer
http://www.fiduswriter.org

Received on Thursday, 18 December 2014 17:55:13 UTC