source: tags/0.9beta/plugins/SpellChecker/readme-tech.html @ 643

Last change on this file since 643 was 643, checked in by ray, 12 years ago

Finally: The first Xinha release! see Ticket #902

File size: 4.6 KB
3  <head>
4    <title>HTMLArea Spell Checker</title>
5  </head>
7  <body>
8    <h1>HTMLArea Spell Checker</h1>
10    <p>The HTMLArea Spell Checker subsystem consists of the following
11      files:</p>
13    <ul>
15      <li>spell-checker.js &mdash; the spell checker plugin interface for
16        HTMLArea</li>
18      <li>spell-checker-ui.html &mdash; the HTML code for the user
19        interface</li>
21      <li>spell-checker-ui.js &mdash; functionality of the user
22        interface</li>
24      <li>spell-checker-logic.cgi &mdash; Perl CGI script that checks a text
25        given through POST for spelling errors</li>
27      <li>spell-checker-style.css &mdash; style for mispelled words</li>
29      <li>lang/en.js &mdash; main language file (English).</li>
31    </ul>
33    <h2>Process overview</h2>
35    <p>
36      When an end-user clicks the "spell-check" button in the HTMLArea
37      editor, a new window is opened with the URL of "spell-check-ui.html".
38      This window initializes itself with the text found in the editor (uses
39      <tt>window.opener.SpellChecker.editor</tt> global variable) and it
40      submits the text to the server-side script "spell-check-logic.cgi".
41      The target of the FORM is an inline frame which is used both to
42      display the text and correcting.
43    </p>
45    <p>
46      Further, spell-check-logic.cgi calls Aspell for each portion of plain
47      text found in the given HTML.  It rebuilds an HTML file that contains
48      clear marks of which words are incorrect, along with suggestions for
49      each of them.  This file is then loaded in the inline frame.  Upon
50      loading, a JavaScript function from "spell-check-ui.js" is called.
51      This function will retrieve all mispelled words from the HTML of the
52      iframe and will setup the user interface so that it allows correction.
53    </p>
55    <h2>The server-side script (spell-check-logic.cgi)</h2>
57    <p>
58      <strong>Unicode safety</strong> &mdash; the program <em>is</em>
59      Unicode safe.  HTML entities are expanded into their corresponding
60      Unicode characters.  These characters will be matched as part of the
61      word passed to Aspell.  All texts passed to Aspell are in Unicode
62      (when appropriate).  <strike>However, Aspell seems to not support Unicode
63      yet (<a
64        href="">thread concerning Aspell and Unicode</a>).
65      This mean that words containing Unicode
66      characters that are not in 0..255 are likely to be reported as "mispelled" by Aspell.</strike>
67    </p>
69    <p>
70      <strong style="font-variant: small-caps; color:
71      red;">Update:</strong> though I've never seen it mentioned
72      anywhere, it looks that Aspell <em>does</em>, in fact, speak
73      Unicode.  Or else, maybe <code>Text::Aspell</code> does
74      transparent conversion; anyway, this new version of our
75      SpellChecker plugin is, as tests show so far, fully
76      Unicode-safe... well, probably the <em>only</em> freeware
77      Web-based spell-checker which happens to have Unicode support.
78    </p>
80    <p>
81      The Perl Unicode manual (man perluniintro) states:
82    </p>
84    <blockquote>
85      <em>
86        Starting from Perl 5.6.0, Perl has had the capacity to handle Unicode
87        natively.  Perl 5.8.0, however, is the first recommended release for
88        serious Unicode work.  The maintenance release 5.6.1 fixed many of the
89        problems of the initial Unicode implementation, but for example regular
90        expressions still do not work with Unicode in 5.6.1.
91      </em>
92    </blockquote>
94    <p>In other words, do <em>not</em> assume that this script is
95      Unicode-safe on Perl interpreters older than 5.8.0.</p>
97    <p>The following Perl modules are required:</p>
99    <ul>
100      <li><a href="" target="_blank">Text::Aspell</a></li>
101      <li><a href="" target="_blank">XML::DOM</a></li>
102      <li><a href="" target="_blank">CGI</a></li>
103    </ul>
105    <p>Of these, only Text::Aspell might need to be installed manually.  The
106      others are likely to be available by default in most Perl distributions.</p>
108    <hr />
109    <address><a href="">Mihai Bazon</a></address>
110<!-- Created: Thu Jul 17 13:22:27 EEST 2003 -->
111<!-- hhmts start --> Last modified: Fri Jan 30 19:14:11 EET 2004 <!-- hhmts end -->
112<!-- doc-lang: English -->
113  </body>
Note: See TracBrowser for help on using the repository browser.