SpellChecker API Redesign

NEW
Unassigned

Status

()

Core
Spelling checker
P3
normal
16 years ago
4 years ago

People

(Reporter: kinmoz, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

16 years ago
This bug is intended for tracking and discussing issues related to a possible 
rewrite of Mozilla's Spellchecker interfaces.

I'll be updating this bug with some of my ideas to start off the discussion. I 
know that David Einstein (Deinst@world.std.com) has some ideas too.
(Reporter)

Updated

16 years ago
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla1.1
(Reporter)

Comment 1

16 years ago
I've been thinking I should've implemented things at 2 different levels so that 
plugging in different spellcheckers would be easier.

At the lowest level, I think there should be a spellchecker interface that knows 
nothing about document structure, selection etc. The aim of this interface is to 
be as simple as possible and allow people to write glue code to their favorite 
spellchecker in under a day's time. This interface would be pretty basic and 
provide methods that allow us to query the dictionaries/languages it supported 
(so we could pass that back to the UI) and allow us to select which ones we 
wanted to use to check words. It would also have a checkWord or lookup method 
that just takes a word (string), the language used in the word's surrounding 
context, and perhaps the charset used in the word. This method would then give 
you back a bool telling you if the dictionaries used thought the word was 
misspelled, and something that allowed us to iterate over the replacement 
suggestions for the word.

At a higher level (spellchecker driver), we would have some interface that knew 
how to operate on DOM nodes ... but the interface itself would take a set of DOM 
ranges, similar to what the new find code uses, which would tell it the bounds 
in which it can operate and where to start/end it's checking. This would allow 
us do things like check the entire document, check specific portions of the 
document, or just what's inside the current selection. Note that this 
implementation would also be able to do checking inside mozilla text widgets 
since it also uses DOM nodes internally.

This higher level interface, would know nothing about selection or the document 
structure either. I'd really like to push that back on the app using this 
"driver". The implementation of this interface would be responsible for 
iterating over the nodes in the "check range" breaking the text into words based 
on the current language of the block and calling the low level interface to 
check the words. If it ran across a word that the low-level interface thought 
was misspelled and perhaps had some suggestions, it would then return a DOM 
range back to the app that represented the location of the word as well as the 
suggested info. The app would then use whatever means it had to select and even 
replace the word. Note that the app could use the new Find/Replace interfaces to 
implement the spellcheckers "change all words" feature.

Note that this driver level implementation could also be given a list of 
low-level spellcheckers to call when checking a word. (Use multiple 
spellcheckers)

We could also have this driver level maintain the user dictionary so that we 
have one list for all the spellcheckers.

We also need to think about a filtering mechanism that will allow us to skip 
over content that is not visible, for example text nodes that between <script> 
tags, etc.

Comment 2

16 years ago
See spellchecker.mozdev.org

I had made a mozISpellchecking engine interface that somewhat implements a low
level interface to a spell checker.  I have not paid as much attention to it as
I could have, but it pretty much does all that I want it to.  I probably want to
add a property setting function so that mozilla can turn on and off special
features of spell checkers.  I think that this will be necessary for system
spellcheckers, like those provided by OSX or KDE and probably others (does XP or
.net provide a system spellchecker?), and I think that it is crucial that we
support these.

I agree with the higher level interface, and was kind of thinking along the
lines of the new nsFind.  I also think that this makes it much easier to skip
unwanted text such as javascript, quoted mail, or signatures.  

The personal dictionary is somewhat tricky in the face of multiple languages, as
the system wide personal dictionary may be monolingual, and a multilingual user
may want to use a mozilla PD for some languages, and the system PD for others.


Updated

16 years ago
Blocks: 119232

Updated

16 years ago
Blocks: 16409

Updated

16 years ago
Blocks: 23421
(Reporter)

Updated

15 years ago
Target Milestone: mozilla1.1alpha → Future

Comment 3

15 years ago
taking
Assignee: kin → rods
Status: ASSIGNED → NEW
Target Milestone: Future → mozilla1.2beta

Updated

15 years ago
Target Milestone: mozilla1.2beta → mozilla1.3alpha
Blocks: 56301

Comment 4

15 years ago
See bug 180346

Comment 5

15 years ago
reassigning
Assignee: rods → kin
(Reporter)

Updated

15 years ago
Target Milestone: mozilla1.3alpha → mozilla1.3beta

Updated

15 years ago
Depends on: 180346
(Reporter)

Updated

15 years ago
Target Milestone: mozilla1.3beta → mozilla1.5alpha
(Reporter)

Updated

14 years ago
Target Milestone: mozilla1.5alpha → mozilla1.5beta

Updated

14 years ago
Assignee: kinmoz → nobody
Component: Editor: Core → Spelling checker
QA Contact: sujay → core.spelling-checker

Updated

14 years ago
Target Milestone: mozilla1.5beta → ---

Comment 6

13 years ago
According to this file
http://www.mozilla.org/quality/browser/front-end/testcases/composer/composer-spellcheck.html
there should be a clickable Help (button or link?) which would open an "About
the Edit Dictionary Box". Are there any plans to implement help, documentation
of some sort regarding Spell Checking?

For now, I'll make bug 256260 dependent of this bug. You may redirect bug 256260
to Documentation and Mozilla Developer (to update that composer-spellcheck.html
file) if there are no plans to implement a Help Button or Documentation of some
sort.

Updated

13 years ago
Blocks: 256260
This bug is about the code interfaces, not the user interface
No longer blocks: 256260

Comment 8

13 years ago
(In reply to comment #0)
> This bug is intended for tracking and discussing issues related to a possible 
> rewrite of Mozilla's Spellchecker interfaces.
> 
> I'll be updating this bug with some of my ideas to start off the discussion. I 
> know that David Einstein (Deinst@world.std.com) has some ideas too.

Hi, not shore if this is the right place for this request. I am not good at
spelling so I would love a "nearest" field in the Mozilla spell cheacker that I
can scroll through. Keep up the great work BTW! ~Mozfan.

Comment 9

11 years ago
Is this bug still relevant or should be be closed?  

Comment 10

11 years ago
(In reply to comment #9)
> Is this bug still relevant

Very much so.

Updated

11 years ago
Blocks: 346461

Updated

10 years ago
Depends on: 413950
No longer depends on: 413950

Updated

9 years ago
Summary: SpellChecker Interface Redesign → SpellChecker API Redesign
You need to log in before you can comment on or make changes to this bug.