Great. That's exactly what we need so that the other platforms can rapidly
implement the necessary matching code.
Could you also include a web-friendly screenshot of your dialog, so that all
the platforms can look the same?
>First, where in the menu should it go?
>I currently have it in Edit, just under Goto, for lack of a better
>location. Should I add a Tools menu?
Eventually we probably want it to to wind up under a Tools menu, but
pulldown menus with only one item always look weird. Until we've got at
least two implemented dialogs to go there, let's do something else.
Temporarily parking it under Edit for now is as good an idea as any.
>And finally, I don't have any back end support for the user dictionaries,
>and the ignore all is faked within the dialog (no persistence). To do
>these things, I was thinking about a xp/xap Spell object, which would
>incapsulate "ignore all" lists, user dictionaries, and abstract the calls
>to the low-level checking routines. We can create one of these at startup,
>and store it in the ap_FrameData class. Ok?
I really like the xap_Spell idea -- having those hardwired calls to that
sloppy C API around ispell is ugly, and quite incomplete. However, I'm not
sure I agree about a few of your factoring choices.
1. If we're only creating one at startup, then it should probably hang off
the app rather than the frame. Having a single personal dictionary open and
used across all open documents sounds like a good design choice.
I doubt we need to engineer for the case where a user wants to use different
personal dictionaries on two documents which are both open at the same time.
Even so, then we should be making that binding on a per-document, not a
per-frame basis. (Otherwise we'd wind up with two views of the same
document getting spell-checked differently, which sounds more confusing than
useful.)
2. By contrast, I'm pretty sure "ignore all" only makes sense as
per-document functionality. If you never want a particular word flagged in
any document, add it to your dictionary. If you don't want it flagged in
*this* document, ignore all.
>Once we have xap_Spell, I can make the dialog persistent, and it will be
>considerably less work to then add the misspelled word context menu.
Cool.
>Oh, one last thing. Can anyone think of a nice algorithm to find sentence
>boundaries? I'm just finding periods now.
My best guess is that a combination of various punctuation marks (periods,
exclamation marks, question marks, etc.) followed by capitalization would be
a decent cue, but even this is likely to run into problems around
abbreviations. If people would reliably double-space, that'd be an even
better cue.
However, I suspect that to get really good results, we'll need to do a *lot*
of language-specific tweaking in that algorithm. If anyone's aware of good
algorithms, that'd be quite useful.
In the mean time, of course, doing the Open Source thing helps. By
isolating an awkward algorithm in a well-defined spot, it's pretty easy to
solicit better patches to replace that code. :-)
Paul