This dictionary and thesaurus extension allows Smalltalk developers to benefit from spelling correction and synonym search within source code. It optionally extends code editors with a spelling correction that underlines unknown terms and typos. These annotations can either be corrected with suitable suggestions or always ignored in case of well-known abbreviations. Moreover, the thesaurus integration provides helpful advice during searching and programming. For example, the source code search has been extended to look also for similar terms and synonyms. As a result, the search presents developers not only exact but also semantic matches.
How to Install
|any, Mac requires spelling plugin,|
|Linux requires Hunspell|
Using Metacello, just run the following code in your workspace:
(Installer mc http: 'http://www.hpi.uni-potsdam.de/hirschfeld/squeaksource/') project: 'MetacelloRepository'; install: 'ConfigurationOfDicThesaurusRex'. (Smalltalk at: #ConfigurationOfDicThesaurusRex) load.
After installation, please check if all test are passing (category DicThesaurusRex-Tests)
How to Use
First, enable the spell checker and thesaurus in Squeak's preferences (Tool bar -> Apps -> Preference Browser). The spell checker (DTR) category contains both options.
Depending on your browser, misspelled words are highlighted in orange and with an underline. After selecting the word and right-click, a browser menu opens suggesting correctly spelled words. Once a specific word has been chosen, the typo will be replaced with it.
Please note: The spelling correction checks not only text but also Smalltalk code. Thus, it is able to find and replace typos in camel case notations.
Instead of checking each method one by one, DicThesaurusRex also offers a complete check of categories, classes, and protocols. After selecting a program entity, right click opens a menu that includes a new entry called check spelling. With that all children are traversed and automatically checked for typos. Finally, a new window opens and presents all identified mistakes. Here, developers can ignore or replace them one by one.
The enabled thesaurus improves the global source code search. Instead of looking only for exact matches, it expands the search space also to synonyms. It can be used with the tool bar search at the top of each Squeak image. After that the result set includes more entries ordered by exact matches and then similar terms. For example, the word test also returns results for try, check, etc.
If a selected word is spelled correctly, then the right-click menu suggests synonyms to developers. As with the spelling correction, words are replaced with the chosen term (this works also for selected camel case source code).
DicThesaurusRex has been developed as part of our software engineering I course at the Hasso-Plattner-Institute, University of Potsdam (summer term 2013).
To date the following people contributed to this project:
- Daniel Neuschäfer-Rube
- Suhanyaa Nitkunanantharajah
- Michael Perscheid
- Jaqueline Pollak
- Jakob Reschke
- PreferenceBrowser.png (32.7 KB ) - added by 8 years ago.
- spellingCorrectionInCodeEditor.png (48.8 KB ) - added by 8 years ago.
- spellingCorrectionEditor.png (118.6 KB ) - added by 8 years ago.
- synonymSearch.png (50.5 KB ) - added by 8 years ago.
- synonymSuggestionInCodeEditor.png (13.7 KB ) - added by 8 years ago.
Download all attachments as: .zip