Sections
Projects
Categories
|
AbstractAs a Kizoom developer one wrote, "Users have come to expect spell-check capabilities from applications that involve natural-language text entry." This would probably be the most substantial of the three projects, involving integrating an Open Source Java spell checker API and dictionaries for the user's natural language. DescriptionImplementing a spell checker includes a couple of tasks: integrating a spell checker API and finding dictionaries. The first of these is just a matter of comparing the various Open Source implementations of Java spell checkers. In addition to the suggested NetBeans module there's at least four other fairly prominent implementations:
Not only does JMySpell support more languages by using the OpenOffice dictionaries but the word lists are fairly small (60-250 KB). This puts them in the range where we could probably retrieve it during the setup wizard rather than requiring the user to find them separately. Since both the JOrtho and JMySpell projects are still active and taking unique approaches to their reference lists I'd like to integrate both into the SIP Communicator (defaulting to JMySpell), and allowing the user to toggle the selection. Since languages rapidly change it's quite possible that Wiktionary will more promptly reflect those changes. For performance reasons the spell checker would only be fired when the keyPressed method handled spaces or the stoppedTypingTimer detected a sizable pause. When either occurred the spell checker would need to check the words on either side of the cursor and underline any misspellings. Future changes within that range of letters would be checked to see if a correction was made. The WritePanelRightButtonMenu would also need to check if the reported click occurred over a word, and if so list possible corrections. It looks like the spell checker could be implemented as a GUI plugin that adds a KeyListener to make the above changes via the UIService's getCurrentChat().addChatEditorKeyListener() method. However, this would still require access to the editorPane, which currently could be done by casting the Chat to a ChatPanel and calling getChatWritePanel().getEditorPane(). However, this obviously a rather poor solution since it depends on implementation details so I'm currently looking for a better one. As for the popup menu, even with complete access to the ChatWritePanel I'm not spotting an elegant means of externally intercepting the mouse events to update the popup menu before it appears (if over a misspelled word). The best (or really 'least worst') solution I've come up with so far would be to add a 'ChatPopupMenuAwareComponent' interface (kinda like the ContactAwareComponent) with the following method: Collection
Which would allow plugins to offer additional menu options based on the context of clicks. However, this is still a rather hacky solution, being far too specific to the needs of the spell checker. |
||||||||||||||||||||