MTSpeling is a Movable Type plugin by Alexei Kosut to add spell-checking capabilities to a Movable Type weblog. It adds a global filter that allows any template tag output to be spell-checked, and provides tags for fully-customizable suggestion output.
Current version: 0.2
- Movable Type. I have only tested with version 2.51, although others may work.
- International Ispell 3.1 or later.
This is a Perl module to access Ispell from Perl. It must be installed
in your site’s Perl installation or the Movable Type
MTSpeling.plinto your Movable Type
MTSpeling.plif necessary with your configuration information. You will need to know the full path location of the
ispellbinary on your system.
Global tag attribute:
Add the check_spelling attribute to any Movable Type
template tag to check its spelling. Pass a value of
“1” to make red any term not in the dictionary (by adding
font tag). For example, to display the
body of an entry with misspelled words in red, you might use:
Use an attribute value of “2” to wrap misspelled words
<span class="spellingerror"> tag, which
allows you to customize the display with a style sheet. To check
spelling, but leave the tag’s output unmodified use a value of
Each tag that is spell-checked will add to the results available
<MTSpellingResults> tag. Following
</MTSpellingResults>, the results will be cleared
for future uses.
Spelling Suggestion Tags
The following tags are available for use in displaying the results of
spelling suggestions (see the Movable Type manual for information on
the use of template tags). These results will include misspelled words from
each prior use of the
A container tag: the contents of this container will be displayed if there has been at least one spelling error. This allows the spelling results to be displayed only if there has been a misspelling.
A container tag representing a list of spelling results, one for each misspelled word in previous uses of the
check_spellingattribute. Each of the following tags are used to display a particular piece of information about a suggestion.
The term that was misspelled.
A container tag: the contents of this container will be displayed if the plugin has suggestions for the current misspelled term. If the word was not in the dictionary, but suggestions are not available, the contents will not be displayed.
A container tag: the contents of this container will be displayed if the plugin has no suggestions for the current misspelled term. If the word was not in the dictionary, but suggestions are not available, the contents will be displayed.
A container tag representing a list of suggestions for the current term.
Used inside a
<MTSpellingResultSuggestions>container, represents a suggestion for the current term.
The following template HTML code will display a comment preview with misspelled words displayed in red, followed by suggestions:
You might use code similar to this in the comment preview template to provide spell-checking for comments.
Spell-checking Weblog Entries
You can add spell-checking to comment previews by modifying the comment preview template, as shown above. However, since Movable Type does not provide access to the templates use to generate the content management system, adding spell-checking to the entry preview requires modifying the Movable Type software, as follows:
lib/MT/Appsubdirectory of your Movable Type installation.
- Find the
preview_entrysubroutine, and the location where the
$preview_codevariable is set. This will be line 2034 in Movable Type 2.51.
- Replace the
$preview_codeinitialization (the lines before
HTML) with your new HTML, including any template tags to display spell-checking information.
- (Optional) You may wish to make use of the
<$MTInclude$> tag, to place your spell-checking code
in a module that can be included from several places. To make the
<$MTInclude$>tag work, you will first need to add the following line of Perl code above the
Don’t forget to make a backup copy of your Movable Type software before making changes, as modifications could make your weblog inaccessible!
Using a personal dictionary
MTSpeling provides support for a personal dictionary of words that
it will treat as spelled correctly, stored as a cookie on the user’s
web browser. The only support in the plugin is to be able to read and
spelling-dict cookie as a colon-seperated list
of words. If you want to make use of this, you’ll have to write your
own code to create and add to this cookie. In my weblog, I use
spelling suggestions that adds a word to this cookie. You could also
write a server-side script to do something similar.
There is no current support in the plugin for dictionaries stored anywhere other than as a cookie in the browser.
- Initial release
- The name is an awful pun. Years ago, I added it to Apache, and now I introduce it to Movable Type. It will not be changed.
Related weblog entries
Comments & Trackbacks
- MTSpeling Plugin
- Re: MTSpeling (Dylan)
- Install me post-haste
- Re: MTSpeling (david)
- Re: MTSpeling (olly)
- Re: MTSpeling (Neil)
- Re: MTSpeling (Yuan-Chung Cheng)
- Beter Speling
- Bugzilla Documentation updates
- add spell-checking in comments
- Re: MTSpeling (Aaron)
- Re: MTSpeling (Del Simmons)
- Why Yes, Those Are New Tweaks
- Re: MTSpeling (Venomous Kate)
- Jabber, Spell Check, Bot, Web page
- So little time...
- So little time...
- Spell checker!
- MTSpeling in 2.64 (works fine!) (Mike)
- Blog spam
- spellnig test
- MT-Preview absolutely rocks, but....
- غلطياب املايي mt
- Re: MTSpeling (Pedro Custodio)
- غلطياب املايي MT
- Spell Check Plugin