Talk:Spell checking

From Apertium
Revision as of 08:38, 13 August 2015 by Unhammer (talk | contribs) (Created page with "==Spell checking for apertium.org?== <selimcan> Web interface certainly needs a spell checker for the source language side – but how? ===contenteditable+sp...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Spell checking for apertium.org?

   <selimcan> Web interface certainly needs a spell checker for the
          source language side

– but how?

contenteditable+spans

We could do something like http://tinymcespellcheck.com/ which makes a rich text area (contenteditable) and uses spans on the spelling errors, in an iframe which contains

<body spellcheck="false" id="tinymce" class="mce-content-body " data-id="mce_0" contenteditable="true">
  <p><span data-mce-bogus="1" class="nanospell-typo">Fromm</span> our <span data-mce-bogus="1" class="nanospell-typo">perpsective</span>, the <span data-mce-bogus="1" class="nanospell-typo">ideel</span> user <span data-mce-bogus="1" class="nanospell-typo">experiense</span></p>
</body>

It's possible to put contenteditable on a div without an iframe as well (though maybe that doesn't work in older browsers?

One problem with contenteditable though, vs our plaintext textarea, is that we would then enable rich-text pastes full of messed-up html from all kinds of badly made sites. Which can lead to all kinds of headaches.

div overlay

Another option would be to keep the plaintext textarea, but put an overlay div that contains red bars and catches right clicks. One problem here is syncing them up on scroll and on other changes to the underlying div.

suggest below textarea

Like how http://joukahainen.puimula.org/webvoikko/spell does it. Google Translate gives suggestions for very short sentences, but gives up on spell checking longer documents, and with very long documents it would probably be a bit bad UI-wise, although we could show only the misspellings as *snippets* below the textarea (and perhaps a maximum of 5 such). So if the user has a long document that contains "and the dog jumpd the fence" then we show just that snippet with "jumpd" underlined and responding to clicks (then we just have to search and replace in the original textarea).