%% This LaTeX-file was created by <kevina> Sat Nov 20 19:11:48 1999
%% LyX 1.0 (C) 1995-1999 by Matthias Ettrich and the LyX Team

%% Do not edit this file unless you know what you are doing.
\documentclass[11pt]{book}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\geometry{verbose,letterpaper,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in}
\setlength\parskip{\medskipamount}
\setlength\parindent{0pt}
\usepackage{url}

\makeatletter


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\providecommand{\LyX}{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
\newenvironment{LyXParagraphIndent}[1]%
{
  \begin{list}{}{%
    \setlength\topsep{0pt}%
    \addtolength{\leftmargin}{#1}
    \setlength\parsep{0pt plus 1pt}%
  }
  \item[]
}
{\end{list}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\newenvironment{lyxcode}
  {\begin{list}{}{
    \setlength{\rightmargin}{\leftmargin}
    \raggedright
    \setlength{\itemsep}{0pt}
    \setlength{\parsep}{0pt}
    \ttfamily}%
   \item[]}
  {\end{list}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{html}

\newcommand{\doubledash}{-\/-}

\begin{htmlonly}

\renewenvironment{lyxcode}
  {\begin{list}{}{
    \setlength{\rightmargin}{\leftmargin}
    \raggedright
    \setlength{\itemsep}{0pt}
    \setlength{\parsep}{0pt}
    \ttfamily}%
   \item[] 
   \begin{ttfamily}}
   {\end{ttfamily}
    \end{list} }

\newenvironment{LyXParagraphIndent}[1]%
{\begin{quote}}
{\end{quote}}

\renewcommand{\LyX}{LyX}

\renewcommand{\doubledash}{\rawhtml &#45;&#45;\endrawhtml}

\end{htmlonly}
\makeatother

\begin{document}


\title{Aspell .28.3 alpha {\Large }\\
\textbf{\large A More Intelligent Ispell}\large }


\author{Kevin Atkinson}

\maketitle
\tableofcontents{}


\chapter{Introduction}

Aspell is an Open Source spell checker designed to eventually replace Ispell.
Its main feature is that it does a much better job of coming up with possible
suggestions than Ispell does. In fact recent tests shows that it even does better
than Microsoft Word 97's spell checker in some cases. In addition it has both
compile time and run time support for other non English languages. Aspell also
doubles as a powerful C++ library with C and Perl interfaces in the works. 


\section{Comparison to other spell checker engines}

\vspace{0.3cm}
{\centering \begin{tabular}{|r|l|c|c|c|}
\hline 
&
Aspell&
Ispell&
Netscape 4.0&
Microsoft Word 97\\
\hline 
Open Source&
x&
x&
&
\\
\hline 
Suggestion Intelligence&
9&
5&
7?&
8\\
\hline 
Personal part of Suggestions&
x&
x&
x&
\\
\hline 
Alternate Dictionaries&
x&
x&
?&
?\\
\hline 
International Support&
x&
x&
?&
?\\
\hline 
\end{tabular}\par}
\vspace{0.3cm}

The suggestion Intelligence is based on a small test kernel of misspelled/correct
word pairs. Go to \url{http://metalab.unc.edu/kevina/aspell/test} for more
info and how you can help contribute to the test kernel. A ? in the suggestion
intelligence means that it is a guess based on personal experience.

If you have any other information you would like to add to this chart please
contact me at kevinatk@home.com.


\subsection{Comparison to Ispell}


\subsubsection{Features that only Aspell has}

\begin{itemize}
\item Does a much better job with coming up with suggestions than Ispell does.
\item Can learn from users misspellings.
\item Is an actual library that others programs can link to instead of having to use
it through a pipe.
\item Is multiprocess intelligent. When a personal dictionary (or replacement list)
is saved it will now first update the list against the dictionary on disk in
case another process modified it.
\item Support for detachable dictionaries \textbf{}so that more than one aspell class
can use the same dictionary.
\item Support for multiple personal dictionaries as well as support for special auxiliary
\textbf{}dictionaries. 
\end{itemize}

\subsubsection{Things that only Aspell will have real soon}


\subsubsection{Things that, currently, only Ispell have}

\begin{itemize}
\item Lower memory footprint
\item Support for affix compression
\item Support for spell checking Latex and Nroff files.
\end{itemize}

\chapter{Getting Started}


\section{Requirements}

Aspell requires gcc 2.8.1, egcs, or gcc 2.95 (or better), as the C++ compiler
or a reasonable C++ standard compliment compiler with SGI's STL or STLPort.
Unless you are using version 3.11 of SGI's STL you will need to apply a patch
to fix a bug in the rope container. (See secion \ref{egcs} for what to do)
That latest version of SGI's STL (\url{http://www.sgi.com/Technology/STL/}),
version 3.11, fixes the bugs in rope and thus does not need to be fixed. 


\section{Obtaining}

The latest version can always be found at Aspell's home page at \url{http://metalab.unc.edu/kevina/aspell}.


\section{Support}

Support for Aspell can be found on the Aspell mailing list. Instructions for
joining the mailing list (and an archive of the mailing list) can be found off
the Aspell home page at \url{http://metalab.unc.edu/kevina/aspell}. 


\section{Helping Out}

The easiest thing you can do to help out it is too send me your \textbf{.aspell.«lang».rpl}
file located in your home directory every so often. (Email kevinatk@home.com)
This file is used to store the replacement pairs. Unless you specifically use
programs that take advantage of this the learning from users mistake feature
this file will be empty so there is no point in sending it.

I will then merge your misspelling with the rest of the data in the test kernel
which will be used to help improve Aspell's suggestion intelligence.

Another thing you can do to help out is to try Aspell out on a different language
as the Language support system is completely untested.


\section{Compiling \& Installing}


\subsection{Generic Install Instructions}

After you have read the sections below and have taken care of any special requirements
for you system simply type

\begin{quote}
./configure \&\& make
\end{quote}
or 

\begin{quote}
./configure \doubledash{}disable-static \&\& make
\end{quote}
to avoid making the static libraries on a system that supports shared libraries.
For additional configure options type ./configure \doubledash{}help.

And Aspell should compile with out any additional user intervention. If you
run into problems please send me a note at kevinatk@home.com with the compiler,
system you are using and any error messages that were produced.

To install the program simply type

\begin{quote}
make install
\end{quote}
And thats all there is too it.

If something goes wrong first see section \ref{egcs} as there is a good change
that that will fix your problem.


\subsection{Upgrading from version .28.2.1}

The behavior of ``aspell check'' changed so that it will now over right the
original file as creating new file was creating too many problems when used
with programs like pine and vi.


\subsection{Upgrading from version .27.2}

The name of the personal word lists have changes from .aspell.per and .aspell.rpl
to .aspell.«lang».per and .aspell.«lang».rpl respectively. «lang» is is the
language name which will generally be ``english''. If you wish to use your
old word lists you will need to rename those files.


\subsection{Upgrading from version .25}

The format of the personal replacement dictionary has changed. So, you will
either need to rename or remove the file \textbf{.aspell.rpl} located in your
home directory. If you have information in this file you would like to preserve
please send me an email.


\subsection{Upgrading from version .24}

Because the location of the main word list moved you should probably do a \textbf{make
uninstall} (with the old version of a Aspell) before upgrading to remove the
old word lists. A make uninstall will not remove any personal word lists.


\subsection{Compiling with Egcs and Gcc 2.8\label{egcs}}

In order for aspell to function properly under egcs or gcc 2.8.{*} you will
need to apply the patch file stl\_rope-30.diff. (Gcc 2.95 uses version 3.11
of SGI's STL and thus does not need this patch applied.) To apply the patch
cd over to the g++ include directory (normally a subdirectory in the normal
include directory) and type in the command

\begin{quote}
patch < \emph{path}/misc/stl\_rope-30.diff
\end{quote}
(where path is the full patch to the location where aspell was unpacked) to
patch the necessary file. If it is impossible for you to do this copy the file
stl\_rope.h to the the directory \emph{src/} in the aspell distribution and
then type the command:

\begin{quote}
patch < ../misc/stl\_rope-30.diff
\end{quote}
Then proceed as normal.

If you do not apply this command aspell will crash when used interactively to
spell check files. ``aspell -a'' and all other aspell modes will work fine
however.


\section{Using as a replacement for Ispell\label{ispell_replasment}}

Aspell can currently function as a drop in replacement for Ispell for programs
that use Ispell through a pipe such as Emacs and \LyX{}. It support the basic
features of Ispell however it does not currently have a Latex or Nroff mode
so there may be situations in which you still wish to use Ispell. Nevertheless,
I have been using Aspell for Xemacs and \LyX{} since the middle of September
of 1998 with out any problems.

The recommended way to use Aspell as a replacement for ispell is to change the
Ispell command from within the program being uses. If that is impossible than
the run-with-aspell script can be used. The format of the script is:

\begin{quote}
run-with-aspell «command»
\end{quote}
where «command» is the name of the program with any optional arguments.

The old method of mapping Ispell to Aspell is discouraged because it can create
compatibility problems with programs that actually require Ispell such as Ispell's
own scripts.


\subsection{Notes on the Learning from Users Mistakes feature}

Because Ispell does not have this feature most all programs that expect Ispell
as the spell checker will not be able to take advantage of this because they
do not communicate back the replacement pairs.

If you want to add support for this feature in your program the best way to
do it is to scan the version string for the string ``Aspell'' and if found
use the ``\$\$ra'' command to communicate back to Aspell the replacement pairs.
See section \ref{data_stream} for more information.


\subsection{Emacs and Xemacs Notes}

The easiest way to use Aspell with Emacs or Xemacs is to add this line:

\begin{lyxcode}
(setq-default~ispell-program-name~\char`\"{}aspell\char`\"{})
\end{lyxcode}
to the end of your .emacs file.

For some reason version 3.0 of ispell.el (the lisp program that (x)emacs uses)
want to reverse the suggestion list. To fix this add this line:

\begin{lyxcode}
(setq-default~ispell-extra-args~'(\char`\"{}-{}-reverse\char`\"{}))
\end{lyxcode}
after the previous line in your .emacs file and it should solve the problem. 

The latest version of ispell.el, version 3.1 (December 1, 1998), has the list
reversing problem fixed. You can find it at \url{http://www.kdstevens.com/~stevens/ispell-page.html}.


\subsection{\LyX{} Notes}

Version 1.0 of \LyX{} provides support for Aspell learning for users mistake
feature.

To use aspell with \LyX{} 1.0 either change the \textbf{spell\_command} option
in the lyxrc file or use the run-with-aspell utility.


\subsection{VIM Notes}

\textit{(}\textbf{\textit{Note:}} \textit{Due to the change in beahvior of ``aspell
check'' the following} \textbf{\textit{will not}} \textit{work without modifiction.)}

The following section was written by \char`\"{}R. Marc\char`\"{} <rmarc@copacetic.net>. 

\emph{Note: The following will not work with Vi as it relies on some Vim specific
features.}

\emph{Impetus: I wanted to use aspell as a replacement for ispell with mutt.
I use vim as my default editor in mutt. The macros for ispell listed in the
vim faq didn't quite work the way I wanted them to when replaced with aspell
and so the following macro/functions were written.}

Macro's and functions can be place in any file you want (see the vim doc's for
alternative methods if you don't like mine). I only have a couple macro's and
functions that I've defined, so I keep all of it in my .vimrc file.

The order in which you define these makes little difference, so I'll start with
the macro's. I've defined 4 macros for the sake of readability, though you can
do them all in one macro if it makes you happy.

\begin{quote}
map aspell to \^{}T \\
map \textbackslash{}1 :let rm = Aspell\_Write()<CR> \\
map \textbackslash{}2 :!aspell check \%<CR> \\
map \textbackslash{}3 :call Aspell\_Clean(rm)<CR><CR> \\
map \^{}T \textbackslash{}1\textbackslash{}2\textbackslash{}3
\end{quote}
\^{}T is a real control character in this example. In order to add that to your
.vimrc using vim you type \char`\"{}<ctrl>-v<ctrl>-t\char`\"{}. Macro's \textbackslash{}1
and \textbackslash{}3 call user defined vim functions that I'll define in a
moment. The gist of what's going on is I write the file, spell check it, then
write over the existing file with the checked file thus yielding a spell checked
document. The way I defined the macro's has the added benefit of bypassing those
silly \char`\"{}Hit RETURN to continue\char`\"{} prompts that Vim is so fond
of displaying when various calls are made.

Now about those functions. Here is what they look like:

\begin{lyxcode}
function~Aspell\_Write()~~\\
~~~~if~strlen(bufname('\%'))~~\\
~~~~~~~~execute~\char`\"{}:w!\char`\"{}~~\\
~~~~else~~\\
~~~~~~~~execute~\char`\"{}:w!~/tmp/Aspellfunc.tmp\char`\"{}~~\\
~~~~~~~~let~rm=1~~\\
~~~~~~~~return~rm~~\\
~~~~endif~~\\
endf

~

function~Aspell\_Clean(rm)~~\\
~~~~execute~\char`\"{}:e!~\%.checked\char`\"{}~~\\
~~~~let~tmp=expand(\char`\"{}\%\char`\"{})~~\\
~~~~execute~\char`\"{}:file~\#\char`\"{}~~\\
~~~~execute~\char`\"{}:w!\char`\"{}~~\\
~~~~call~delete(expand(tmp))~~\\
~~~~if~a:rm~~\\
~~~~~~~~call~delete(expand(\char`\"{}\%\char`\"{}))~~\\
~~~~endif~~\\
endf
\end{lyxcode}
Aspell\_Write checks to see if the file being checked has been named yet or
not. If it's not been named, it writes to a file called /tmp/Aspellfunc.tmp.
There is the potential of problems with this if you are spell checking multiple
unnamed files at the same time. This isn't a problem for me, so I didn't go
to great lengths to insure uniqueness. Also, if the file is unnamed, the rm
flag is set so we know we need to remove the tmp file when we are done. If it's
already has a name, the file is simply written.

Aspell\_Clean takes one argument; the rm flag. It overwrites the existing file
with the spell checked version, sets the filename to what it should be and then
removes the checked file. If the rm flag is set, the temporary file written
for the unnamed file is removed.


\chapter{The Aspell utility}

The Aspell utility is a multipurpose utility that can function as a ``ispell
-a'' replacement, as an independent spell checker, and as a utility for managing
dictionaries. Here is a brief summary of Aspell's command line options.

\begin{quote}
aspell {[}options{]} «command» \\

\end{quote}
«command» is one of:

\begin{description}
\item [check~«file»]to check a file
\item [pipe]'ispell -a' compatible mode.
\item [dump~config]dump the current configuration to stdout
\item [dump|create|merge~maser|personal|repl~{[}word~list{]}]dumps, creates, or merges
a master, personal, or replacement word list.
\end{description}
{[}options{]} is any or all of the following standard aspell library options:

\begin{description}
\item [-d,~\doubledash{}master=«base»]main word list base name
\item [-p,~\doubledash{}personal=«file»]personal word list file name
\item [\doubledash{}repl=«file»]replacements list file name
\item [\doubledash{}lang=«lang»]default language to use
\item [\doubledash{}dict-dir=«dir»]location of the main word list
\item [\doubledash{}data-dir=«dir»]location of language data files
\item [\doubledash{}{[}dont-{]}ignore-repl]{[}don't{]} ignore commands to store replacement
pairs
\item [\doubledash{}conf=«file»]main configuration file
\item [\doubledash{}conf-dir=«dir»]location of main configuration file
\end{description}
in addition to

\begin{description}
\item [\doubledash{}reverse]reverse the order of the suggestions list.
\item [-b~\doubledash{}backup]create a backup file by appending ``.bak'' to the file name.
(Only applies when the command is check)
\item [-x~\doubledash{}dont-backup]don't create a backup file
\end{description}
In addition Aspell with try to make seance out of Ispell's command line options
so that it can function as a drop in replacement for Ispell when used is ``-a''
mode.

If Aspell is specified with out any command line options it will display a brief
help screen and quit.

Aspell can also make use of a global or user configuration file. Each line of
the configuration file has the format:

\begin{lyxcode}
«option»~{[}args{]}
\end{lyxcode}
where option is any one of the standard library options above without the leading
dashes. For example the following line will set the default language to German:

\begin{lyxcode}
lang~german
\end{lyxcode}
Anything from a ``\#'' to a newline is ignored. The global configuration file
is usually named ``aspell.conf'' and is found in the etc directory while the
user configuration file is usually named ``.aspell.conf'' and is found in
the users home directory. Use ``aspell dump config'' to found out what they
are for your installation.

The environmental variable ASPELL\_CONF may also be used and it overrides any
options set in the configuration file. The format of the string is exactly the
same as the configuration file except that semicolons ( ; ) are used instead
of newlines.


\section{As a ``ispell -a'' replacement}

To actually use Aspell as an Ispell replacement simply follow the directions
in section \ref{ispell_replasment}.

When given the \textbf{pipe} or \textbf{-a} command aspell goes into a pipe
mode the is compatible with ispell with a few extra additions.


\subsection{Format of the Data Stream\label{data_stream}}

In this mode, Aspell prints a one-line version identification message, and then
begins reading lines of input. For each input line, a single line is written
to the standard output for each word checked for spelling on the line. If the
word was found in the main dictionary, or your personal dictionary, then the
line contains only a '{*}'. 

If the word is not in the dictionary, but there are suggestions, then the line
contains an '\&', a space, the misspelled word, a space, the number of near
misses, the number of characters between the beginning of the line and the beginning
of the misspelled word, a colon, another space, and a list of the suggestions
separated by commas and spaces.

Finally, if the word does not appear in the dictionary, and there are no suggestions,
then the line contains a '\#', a space, the misspelled word, a space, and the
character offset from the beginning of the line. Each sentence of text input
is terminated with an additional blank line, indicating that ispell has completed
processing the input line. 

These output lines can be summarized as follows: 

\begin{description}
\item [OK:]{*} 
\item [Suggestions:]\& «original» «count» «offset»: «miss», «miss», ... 
\item [None:]\# «original» «offset» 
\end{description}
When in the -a mode, Aspell will also accept lines of single words prefixed
with any of '{*}', '\&', '@', '+', '-', '\~{}', '\#', '!', '\%', or '\^{}'.
A line starting with '{*}' tells ispell to insert the word into the user's dictionary.
A line starting with '\&' tells ispell to insert an all-lowercase version of
the word into the user's dictionary. A line starting with '@' causes ispell
to accept this word in the future. A line starting with '+', '-', or '\~{}',
is ignored for ispell compatibility. A line prefixed with '\#' will cause the
personal dictionary to be saved. A line prefixed with '!' will turn on terse
mode (see below), and a line prefixed with '\%' will return ispell to normal
(non-terse) mode. Any input following the prefix characters '+', '-', '\#',
'!', '\~{}', or '\%' is ignored, as is any input following. To allow spell-checking
of lines beginning with these characters, a line starting with '\^{}' has that
character removed before it is passed to the spell-checking code. It is recommended
that programmatic interfaces prefix every data line with an uparrow to protect
themselves against future changes in Aspell. 

To summarize these: 

\begin{description}
\item [{*}~«word»]Add a word to the personal dictionary 
\item [\&~«word»]Insert the all-lowercase version of the word in the personal dictionary
\item [@~«word»]Accept the word, but leave it out of the dictionary 
\item [\#]Save the current personal dictionary 
\item [\~{}]Ignored
\item [+]Ignored
\item [-]Ignored
\item [!]Enter terse mode 
\item [\%]Exit terse mode 
\item [\^{}]Spell-check the rest of the line 
\end{description}
In terse mode, Aspell will not print lines beginning with '{*}', which indicate
correct words. This significantly improves running speed when the driving program
is going to ignore correct words anyway.

In addition to the above commands which are designed for Ispell compatibility
Aspell also supports its own extension. All Aspell extensions follow the following
format.

\begin{quote}
\$\$«command» {[}data{]}
\end{quote}
Where data may or may not be required depending on the particular command. Aspell
currently supports the following command.

\begin{description}
\item [m~which]Print out the current mode
\item [m~none]Do not use any special mode.
\item [m~url]Enter email, URL, and host name skipping mode.
\item [s~«word1»,«word2»]Returns the score of the two words based roughly on how aspell
would score them.
\item [Sw~«word»]Returns the soundlike equivalent of the word.
\item [Sl~«word»]Returns a list of words that have the same soundlike equivalent.
\item [Pw~«word»]Returns the phoneme equivalent of the word.
\item [pp]Returns a list of all words in the current personal wordlist.
\item [ps]Returns a list of all words in the current session dictionary.
\item [l]Returns the current language name.
\item [ra~«mis»,«cor»]Add the word pair to the replacement dictionary for latter use.
Returns nothing.
\item [ric]Returns the status of the ignore\_replacements flag which will either be
a 1 or a 0.
\item [ri0]Sets the ignore\_replacement flag to false (the default). Returns nothing.
\item [ri1]Sets the ignore\_replacement flag to true. Returns nothing.
\end{description}
Anything returned is returned on its own line line. All lists returned have
the following format

\begin{quote}
«num of items»: «item1», «item2», «etc»
\end{quote}
\emph{(Note: part of this section was directly copied out of the Ispell manual)}


\subsubsection{Notes of Storing Replacement Pairs\label{replpair}}

As of version .27 of Aspell storing replacements pairs has a memory. Which means
if you first store the replacement pair:

\begin{quote}
sicolagest -> psycolagest
\end{quote}
then store the replacement pair

\begin{quote}
psycolagest -> psychologist
\end{quote}
The replacement pair

\begin{quote}
sicolagest -> psychologist
\end{quote}
will also get stored so that you don't have to worry about it.


\section{As an independent spell checker}

To use Aspell as an independent spell checker type

\begin{quote}
aspell check «filename»
\end{quote}
Where «filename» is the file you want to check. Aspell will create a new file
named \textbf{«filename».checked} with the corrections and the original file
is untouched.


\section{As an utility to manage word lists}

To create the main word list from a list of words use the command

\begin{quote}
aspell \doubledash{}lang=«lang» create master ./«base» < «wordlist»
\end{quote}
where «base» is the name of the word list and «word list» is the list of words
seperated by white space. The ``./'' is important because without it aspell
will create the word list in the normal word list directory. 

This will create two files in the current directory. To use the new word list
copy the files to the normal word list directory (use ``aspell dump config''
to find out what it is) and use the option \doubledash{}master=«base».

A personal and replacement word list can be created in a similar fashion.

Please note that Aspell currently does not support any sort of affix compression
like Ispell does. Thus Ispell's word list will not work as is. In order to use
Ispell's word lists simply pipe the word list through ``ispell -e'' to expand
the munched word lists. 

The replacement word has each replacement pair on its own line in the following
format

\begin{lyxcode}
«misspelled~word»:~«correction»
\end{lyxcode}
The dump command will simply dump the contents of a word list to stdout in a
formate than can be read back in with \textbf{aspell create}.

If no word list is specified the command will act on the default one. For example
the command 

\begin{quote}
aspell dump master
\end{quote}
will simply dump the contents of the current master word list to stdout.


\chapter{Library Interface}


\section{The C++ Library}

The new C++ library makes heavy use of modern C++ features and the STL. Documenation
should be completed soon. For right now please see the header files installed
with the distribution (usually under /usr/local/include/aspell/). For examples
of how to use the C++ please see the source for the aspell utility (located
under src/aspell.cc)


\section{The C Library Interface}

I am also providing a C interface so that C programmers can use my library without
a lot of hassle. Unfortunately because my actually library is C++ code there
are several cravats to linking C to C++ code according to the C++FAQ Lite:

\begin{itemize}
\item Your must use your C++ compiler when compiling main() (e.g., for static initialization)
\item Your C++ compiler should direct the linking process (e.g., so it can get its
special libraries) 
\item Your C and C++ compilers probably need to come from same vendor and have compatible
versions (e.g., so they have the same calling conventions) 
\end{itemize}
However depending on the compiler and/or linker you are using you may be able
to get away with not doing one or more of these things. Your mileage may vary.

\textbf{Unfortunately due to a major rewrite of the C++ library the C library
is currently unavailable. I hope to have it back in a release or two.}


\section{Notes About Thread Safety}

Readonly Aspell methods and functions should be thread safe as long as exceptions,
new, delete, delete{[}{]}, and STL allocators are thread safe. To the best of
my knowledge gcc and egcs meet these requirements. It is up to the programmer
to make sure multiple threads do not do thing such as change the dictionaries
and add or delete items from the personal or session dictionaries.


\chapter{International Support}

Aspell international support is currently under going a major rewrite. So, for
right now the best thing to do if you want to see your language supported is
to send me the following information:

\begin{itemize}
\item The iso-{*} character set used for your language
\item Any nonword characters that can appear in a word such as a dash
\item Any other special considerations for you language such as allowing run together
words.
\item A small word list of around 1,000 words so that I can test things out.
\end{itemize}
I will then get back to you with necessary files and instructions on how to
get things set up. My email is kevinatk@home.com.

More information on my future planes for international support in aspell can
be found at \url{http://metalab.unc.edu/kevina/aspell/international/}.


\chapter{How Aspell Works\label{works}}

The magic behind my spell checker comes from merging Lawrence Philips excellent
metaphone algorithm and Ispell's near miss strategy which is inserting a space
or hyphen, interchanging two adjacent letters, changing one letter, deleting
a letter, or adding a letter.

The process goes something like this.

\begin{enumerate}
\item Convert the misspelled word to its soundslike equivalent (its metaphone for
English words).
\item Find words that have the same soundslike pattern.
\item Find words that have similar soundslike patterns. A similar soundlike pattern
is a pattern that is obtained by interchanging two adjacent letters, changing
one letter, deleting a letter, or adding a letter.
\item FInd misspelled words that have a correctly spelled replacement by the same
criteria of step number 2 and 3. That is the misspelled word in the word pair
(such as teh->the) would appear in the suggestions list as if it was a correct
spelling.
\item Score the result list and return the words with the lowest score. The score
is roughly the weighed average of the edit distance of the word to the misspelled
word, the soundslike equivalent of the two words, and the phoneme of the two
words. The edit distance is the weighed total of the number of deletions, insertions,
exchanges, or adjacent swaps needed to make one string equivalent to the other.
\item Replace the misspelled words that have correctly spelled replacements with their
replacements and remove any duplicates that might arise because of this.
\end{enumerate}
Please note that the soundslike equivalent is a rough approximation of how the
words sounds. It is not the phoneme of the word by any means. For more details
about exactly how each step is performed please see the file \textbf{suggest.cc}.
For more information on the metaphone algorithm please see the file \textbf{metaphone.cc}
which included a detailed description of it.

\appendix


\chapter{Changelog}


\section*{Changes from .28.2.1 to .28.3 (Nov 20, 1999)}

\begin{itemize}
\item Fixed a bug that caused aspell to crash when spell checking words over 60 characters
long.
\item Reworked ``aspell check'' so that

\begin{enumerate}
\item You no longer have to hit enter when making a choice.
\item It will now overwrite the orignal file instead of creating a new file. An optional
backup can be made by using the -b option.
\end{enumerate}
\item Fixed a few bugs in data.cc.
\end{itemize}

\section*{Changes from .28.2 to .28.2.1 (Aug 25, 1999)}

\begin{itemize}
\item Fixed the version number for the shared library.
\item Fixed a problem with undefined refrences when linking to the shared library.
\end{itemize}

\section*{Changes from .28.1 to .28.2 (Aug 25, 1999)}

\begin{itemize}
\item Fixed a bunch of bugs in the language and configuration classes.
\item Minor changed in the code so that it could compile with the new gcc 2.95(.1).
\item Changed the output of ``dump config'' so that default values are given the
value \char`\"{}<default>\char`\"{}. This means that the output can be used
to created a configuration file.
\item Added notes on using aspell with VIM.
\end{itemize}

\section*{Changes from .28 to .28.1 (July 27, 1999)}

\begin{itemize}
\item Removed some debug output
\item Changed notes on compiling with gcc 2.8.{*} as I managed to get it to compile
on my school account
\item Avoided included \textbf{stdexcept} in \textbf{const\_string.hh} so that I could
get to compile on my schools account with gcc 2.8.1.
\end{itemize}

\section*{Changes from .27.2 to .28 (July 25, 1999)}

\begin{itemize}
\item Provided an iterator for the replacement classes.
\item Added support for dumping and creating and merging the personal and replacement
word lists.
\item Changed the aspell utility command line a bit, it now used popt.
\item Totally reworked aspell configuration system. Now aspell can get configuration
from any of 5 sources: the command line, the environmental variable ASPELL\_CONF,
the personal configuration file, the global configuration file, and finally
the compiled in defaults. 
\item Totally reworked the language class in preparation for my new language code.
See \url{http://metalab.unc.edu/kevina/aspell/international/} for more information
of what I have in store.
\item Added some options to the configure script: \doubledash{}enable-dict-dir=DIR, \doubledash{}enable-doc-dir=DIR,
\doubledash{}enable-debug, and \doubledash{}enable-opt
\item Removed some old header files.
\item Reoriginized the directory structure a bit
\item Made the text version of the manual pages slightly easier to read
\item Used the \textbackslash{}url command for urls for better formating of the printed
version.
\end{itemize}

\section*{Changes from .27.1 to .27.2 (Mar 1, 1999)}

\begin{itemize}
\item Fixed a major bug that caused aspell to dump core when used without any arguments 
\item Fixed another major bug that caused aspell to do nothing when used in interactive
mode.
\item Added an option to exit in Aspell's interactive mode.
\item Removed some old documentation files from the distribution.
\item Minor changes on to the section on using Aspell with egcs.
\item Minor changes to remove -Wall warnings.
\end{itemize}

\section*{Changes from .27 to .27.1 (Feb 24, 1999)}

\begin{itemize}
\item Fixed a minor compile problem.
\item Updated the section on using Aspell with egcs to it it more clear why the patch
is necessary.
\end{itemize}

\section*{Changes from .26.2 to .27 (Feb 22, 1999)}

\begin{itemize}
\item \textbf{Totally reworked the C++ library which means you may need to change
some things in your code.}
\item Added support for detachable and multiple personal dictionaries in the C++ class
library.
\item The C++ class library now throws exceptions.
\item Reworked aspell ability to learn from users misspellings a bit so that it now
has a memory. See section \ref{replpair} for more information.
\item Upgraded autoconf to version 2.13 and automake to version 1.4 for better portability.
\item Fixed the configuration so the ``make dist'' will work. For now on aspell
will be distributed with ``make dist''.
\item Added support to skip over URL's, email addresses and host names.
\item Added support for dumping the master and personal word list. You can now also
merge a personal word list. Type aspell -help for help on using this feature. 
\item Reorganized the source code.
\item Started using proper version numbers for the shared library.
\item Fixed a bug that caused a spell to crash when adding certain replacement pairs.
\item Fixed the problem with duplicate lines when exiting pipe mode for good.
\end{itemize}

\section*{Changed from .26.1 to .26.2 (Jan 3, 1998)}

\begin{itemize}
\item Fixed another compile problem. Hopefully this time it will really compile OK
on other peoples machines.
\end{itemize}

\section*{Changed from .26 to .26.1 (Jan 3, 1998)}

\begin{itemize}
\item Fixed a small compile problem in \textbf{as\_data.cc}.
\end{itemize}

\section*{Changed from .25.1 to .26 (Jan 3, 1999)}

\begin{itemize}
\item Fixed a bug that causes duplicates items to be displayed in the suggestion list
for good. (If it still does it please send be email.)
\item Added the ability for aspell to learn form the users misspellings.
\item Library Interface changes. Still more to come....
\item Is now multiprocess safe. When a personal dictionary (or replacement list) is
saved it will now first update he list against the dictionary on disk in case
another process modified it.
\item Fixed the bug that caused duplicate output when used non interactively in pipe
mode.
\item Dropped support for gcc 2.7.2 as the C++ compiler.
\item Updated the How Aspell Works (\ref{works}) Chapter.
\item Added support for the ASPELL\_DATA\_DIR environmental variable.
\end{itemize}

\section*{Changes from .25 to .25.1 (Dec 10, 1998)}

\begin{itemize}
\item Fixed the version number so that Aspell reports the correct version number.
\item Changed the note on gcc 2.7.2 compilers to make it clear that only the C++ compiler
can not be gcc 2.7.2, it is ok if the C compiler is gcc 2.7.2.
\item Updated the TODO list and reorganized it a bit.
\item Fixed the directory so that all the documentation will get installed in \$\{prefix\}/doc/aspell
instead of half of it in \$\{prefix\}/doc/aspell and half of it in \$\{prefix\}/doc/kspell.
\end{itemize}

\section*{Changes from .24 to .25 (Nov 23, 1998)}

\begin{itemize}
\item Total rework of how the main word list is stored. Start up time decreased to
about 1/3 of what it was in .24 and memory usage decreased to about 2/3. (When
used with the provided word list on a linux system). \textbf{}Also the \textbf{format
and default locations of the main word list data files changed} in the process
and the data \textbf{is now machine dependent}. The personal word list format,
however, stayed the same.
\item Changed the scoring method to produce slightly better results with words like
the vs. teh. And other simpler misspellings where two letters are swapped.
\item Fixed the very unpredictable behavior of the '{*}', '\&', '@' commands in the
pipe mode.
\item Added documentations for Aspell pipe mode (also known as ispell -a compatibility
mode)
\item Added a bunch of Aspell specific extensions to the pipe mode and documented
them.
\item Documented the \textbf{to\_soundslike} and \textbf{soundslike} methods for the
\textbf{aspell} class.
\item Changed the scoring method to produce better results for words like ``fone''
vs ``phone'' and other words that have a spelling that doesn't directly relate
to how the word sounds by using the phoneme equivalent of the word in the scoring
of it.
\item Added the \textbf{to\_phoneme} and \textbf{have\_phoneme} methods to the \textbf{SC\_Language}
class.
\item Added the \textbf{to\_phoneme} method to the \textbf{aspell} class.
\item Added the framework for being able to learn from the users misspelling. Right
now it just keep a log of replacements.
\item Redid \textbf{stl\_rope-30.diff}. \textbf{}For some reason the version of patch
on my system refused it.
\item Rewrite of the ``Using as a replacement for Ispell'' section and added the
\textbf{run-with-aspell} utility as a replacement of the old method of mapping
Ispell to Aspell.
\item Fixed a bug that caused duplicate words to appear in the suggestion list.
\end{itemize}

\section*{Changes from .23 to .24 (Nov 8, 1998)}

\begin{itemize}
\item Fixed my code so that it can once again compile with g++ 2.7.2.
\item Rewrote the How It Works chapter.
\item Rewrote the Requirement section and added noted on compiling with g++ 2.7.2.
\item Added a To Do chapter.
\item Added a Glossary and References chapter.
\item Other minor documentation improvements.
\item Internal code documentation improvements.
\end{itemize}

\section*{Changes from .22.1 to .23 (Oct 31, 1998)}

\begin{itemize}
\item Minor documentation fixes.
\item Changed the scoring strategy for words with 3 or less letters. This cut the
number of words returned for these roughly in half.
\item Expanded the word list to also include \textbf{american.0} and \textbf{american.1}
from the Ispell distribution. It now includes \textbf{english.0}, \textbf{english.1},
\textbf{american.0} and \textbf{american.1} from the directory \textbf{languages/english}
provided with Ispell 3.1.20.
\item Added a link to the location of the latest Ispell.el in the documentation.
\item Started a C interface and added some rough documentation for it.
\end{itemize}

\section*{Changes from .22 to .22.1 (Oct 27, 1998)}

\begin{itemize}
\item Minor bug fixes. I was deleting arrays with delete rather than delete{[}{]}.
I was suppressed that this had not created a problem.
\item Added a simple test program to test for a memory leak present on some systems.
(Only debian slink at the moment.) See the file memleak-test.cc for more info.
\end{itemize}

\section*{Changes from .21 to .22 (Oct 26, 1998)}

\begin{itemize}
\item Major redesign or the scoring method. It now uses absolute distances rather
than relative scores for more consistent results. See suggest.cc for more info.
\item Suggest code rewritten is several places however the core process stayed the
same.
\item The suggest\_ultra method temporally does nothing. It should be working again
by the next release.
\end{itemize}

\section*{Changes from .20 to .21 (Oct 13, 1998)}

\begin{itemize}
\item Added documentation for aspell::Error
\item \textbf{Changed the library name from libspell to libaspell.} It should never
have been libspell in the first place. Sorry for the incompatibility.
\item Added \textbf{as\_error.hh} to the list of files copied to the include directory
so that you can actually use the library outside of the source dir.
\item Fixed bug that caused a segmentation fault with words where the only suggestions
was inserting a space or hyphen such as in ``ledgerline''.
\item Added the \textbf{score} method to \textbf{aspell}.
\item Changed the scoring method to deal with word when the user uses \char`\"{}f\char`\"{}
in place of \char`\"{}ph\char`\"{} a lot better.
\end{itemize}

\section*{Changes from .11 to .20 (Oct 10, 1998)}

\begin{itemize}
\item \textbf{Name change.} \textbf{\emph{}}\textbf{Everything that was Kspell is
now Aspell.} Sorry, the name Kspell was already used by KDE and I didn't want
to cause any confusion.
\item Fixed a bug that causes a segmentation fault when the HOME environmental variable
doesn't exist.
\end{itemize}

\section*{Changes from .10 to .11 (Sep 12, 1998)}

\begin{itemize}
\item Overhaul of the SC\_Language class
\item Added documentation for international support
\item Added documentation for the C++ library
\item Other minor bug fixes.
\end{itemize}

\chapter{To Do}

Words in bold indicate how you should refer to the item when discussing it with
me or others.


\section{Things that will be done real soon}

These items should get done within a release or two.

\begin{itemize}
\item Handle capitulation better when storing replacement pairs.
\item Finish up support for detachable and multiple dictionaries, right now aspell
will not work right with multiple replacement dictionaries.
\item Totally rewrite the aspell international support. See \url{http://metalab.unc.edu/kevina/aspell/international/}
for more information.
\item Rework the aspell \textbf{check} function to provide support for using any number
of filters which will be needed for international support.
\item Namespace clean up. Chose a naming sceme for all of aspell functions and classes
and stick to it.
\item Write documentation for the library interface.
\item Bring back the C interface library.
\end{itemize}

\section{Things that need to be done}

Things items will eventually be implemented as I know they are important however
I am not sure when they will get done.

\begin{itemize}
\item Add support for \textbf{affix compression.}
\item Figure out a way for Aspell to work better with \textbf{extremely large dictionaries}.
\end{itemize}

\section{Things that I would like to get done}

These items will eventually be implemented. I hope to have them all done before
I move aspell to beta testing. They are in the approximate order of when they
will get done.


\section{Things that will be done eventually}

I plan on doing these things eventually. It is just a matter of getting around
to it.

\begin{itemize}
\item Bring the \textbf{suggest\_ultra} method back.
\end{itemize}

\section{Good ideas that are worth implementing}

These items all sound like good ideas however I am not sure when I will get
to implementing then if ever. If you are looking for a way to contribute picking
up on one of these ideas would be a great way to start. They are presented in
no particular order.

\begin{itemize}
\item Come up with a \textbf{full screen terminal} interface similar to Ispell's.
\item Come up with a plug-in for \textbf{gEdit} the gnome text editor.
\item Create a \textbf{debian package} for both the Aspell utility and the library.
\item Create a \textbf{RPM} \textbf{package} for both the Aspell utility and the library.
\item Change languages (and thus dictionaries) based on the information in the actual
document.
\item Come up with an \textbf{HTML mode} for spell checking. 
\item Come up with a \textbf{\TeX{} mode} and a \textbf{nroff mode} for spell checking.
\item Come up with a \textbf{C mode}, a \textbf{C++ mode}, a \textbf{Perl mode}, etc
for spell checking.
\item Come up with a mode that will skip words based on the symbols that (almost)
always surround the word. (\textbf{Word skipping by context})
\item Create two \textbf{server modes} for Aspell. One that uses the \textbf{DICT}
protocol and one that uses \textbf{ispell -a} method of communication of some
arbitrary port.
\item Improve the \textbf{C interface} and documentation.
\item Come up with a \textbf{Perl interface}.
\item Come up with \textbf{thread safe personal dictionaries}.
\item \textbf{Tablelise} the \textbf{to\_soundslike} method.
\item Use the \textbf{Hidden Markov Model} to base the suggestions on not only the
word itself but on the context around the word.
\end{itemize}

\section{Things that are not likely to get implemented}

Theses ideas are not likely to get implemented any time soon.

\begin{itemize}
\item (None Yet)
\end{itemize}

\section{Notes and Status of various items}


\subsection{Affix Compression\label{affixcomp}}

Due to the current way my spell checker works implementing affix compression
would be next to impossible. Nevertheless, I do realize that for some languages
affix compression is very important.

So to solve this dilemma I plan on having two different modes of my spell checker:
One with affix compression that does not use soundslike pairs (much like ispell)
and one without affix compression that does use soundslike. 

I plan to extract the affix manipulation code from Ispell with the help of an
Ispell author. The tricky part would be getting this to getting this all to
work properly at tun time bases on the dictionary used.


\subsection{Extremely Large Dictionaries}

This problem extends back to the fact of the way words are index is Aspell.
This problem will get resolved when I implanted the affix compression mode as
only one index would be used.


\subsection{General region skipping}

I want to implement this give other people an idea of how it should be done
and because I am really sick of having to spell check through url and email
address.


\subsection{Word skipping by context}

This was posted on the Aspell mailing list on January 1, 1999:

I had an idea on a great general way to determine if a word should be skipped.
Determine the words to skip based on the symbols that (almost) always surround
the word.

For example when asked to check the following C++ code:

\begin{lyxcode}
cout~<\textcompwordmark{}<~\char`\"{}My~age~is:~\char`\"{}~<\textcompwordmark{}<~num~<\textcompwordmark{}<~endl;~~\\
cout~<\textcompwordmark{}<~\char`\"{}Next~year~I~will~be~\char`\"{}~<\textcompwordmark{}<~num~+~1~<\textcompwordmark{}<~endl;~
\end{lyxcode}
cout, num, and endl will all be skipped. \char`\"{}cout\char`\"{} will be skipped
because it is always preceded by a <\textcompwordmark{}<. \char`\"{}num\char`\"{}
will be skipped because it is always preceded by a <\textcompwordmark{}<. And
\char`\"{}endl\char`\"{} will be skipped because it is always between a <\textcompwordmark{}<
and a ;.

Given the following html code.

\begin{lyxcode}
<table~width=50\%~cellspacing=0~cellpadding=1>~~\\
<tr><td>One<td>Two<td>Three~~\\
<tr><td>1<td>2<td>3~~\\
</table>~\\
~\\
<table~cellspacing=0~cellpadding=1>~~\\
</table>
\end{lyxcode}
table, width cellspacing, cellpadding, tr, td will all be skipped because they
are always inclosed in \char`\"{}<>\char`\"{}. Now of course table and width
would be marked as correct anyway however there is no harm in skipping them.

So I was wondering if anyone on this list has any experience in writing this
sort of context recognition code or could give me some pointers in the right
direction.

This sort of word skipping will be very powerful if done right. I imagine that
it could replace specific spell checker modes for Tex, Nroff, SGML etc because
it will automatically be able to figure out where it should skip words. It could
also probably do a very good job on programming languages code.

If you are interested in helping be out with this or just have general comments
about the idea please let me know.


\subsection{Tablelise to\_soundslike}

Geoff Kuenning (one of the Ispell authors) gave me this idea. He suggest that
I table-drive the conversion instead of hard wiring the code to encourage other
people to come up with a to\_soundslike method for their language. ``My experience
with ispell leads me to believe that if we could give fairly explicit instructions
about how to design a metaphone algorithm for a language, there are people out
there who are eager to do the work.''

This sounds like a good idea to and it is something I hope to implement eventually
as it would surely beat my current crude method of just deleting all the values
for languages without a customized to\_soundslike method for the language.


\subsection{Hidden Markov Model}

Knud Haugaard Sørensen suggested this one. From his email on the Aspell mailing
list:

\begin{quote}
consider this examples.

a fone number. -> a phone number. \\
a fone dress. -> a fine dress.

the example illustrates that the right corection might depend on the context
of the word. So I suggest that you take a look on HMM to solve this problem.

This might also provide a good base to include gramma correction in aspell.

see this link \url{http://www.cse.ogi.edu/CSLU/HLTsurvey/ch1node7.html}
\end{quote}
I think it is a great idea. However unfortunately it will probably be very complicated
to implement. Perhaps in the far future...


\chapter{Support for Gcc 2.7.2}

(and other non-standard compliance compilers)

My original plan was to program in such a way that it would Aspell would compile
under Gcc 2.7.2 however after releasing a rather nasty bug in 2.7.2 with nested
typed I have desired to drop all support for G++ 2.7.2. As of Aspell .27 all
hope for being able to compile under Gcc 2.7.2 is lost as I am now using many
modern C++ features which are simply not present in C++ most notably template
specialization and template members. Egcs 1.1.1 is a very good standards compliant
compiler and that is now the officially supported compiler. However as Egcs
1.1.1 is relatively new and, except for namespaces, provides little new functionality
I will continue to support Egcs 1.0.3. Gcc 2.8.1 should in theory work however
it is so buggy I have yet to get it to compile with it nor has anyone else that
I know of.

Yes, my code could be rewritten so that is could compile under Gcc 2.7.2 but
Why? Using modern C++ has probably accelerated the development of this library
my at least 50\%. And for that matter why stop at Gcc 2.7.2 why not go all out
and totally rewrite my code pure C. I hope you see my point.

However that does not mean I want to sacrifice portability unnecessarily. If
you see any of part of my code that in not Standard C++ please let me know.
My hope is that my code could compile on all Standard compliance C++ compilers
with the addition of a few extra header files from SGI's STL.

As I side note I think that Mozilla's C++ portability guide (\url{http://www.mozilla.org/docs/tplist/catBuild/portable-cpp.html})
could be summed up in one sentence: Program in the dark ages of C++. 


\chapter{Credits}

\begin{itemize}
\item To the many authors of Ispell (including R. E. Gorin, Pace Willisson, and Geoff
Kuenning) for providing me with a good word list as well as giving me a few
good ideas.
\item Lawrence Philips for coming up with the original metaphone algorithm and Michael
Kuhn for writing C code for the algorithm.
\item To the authors of SGI STL version 3.0 and up for proving a great set of generic
container classes with cut the development time of this program in half at least.
\item To the \LyX{} development team for giving me a great tool for the development
of this manual.
\item JAmes Atwill for providing me an account on his machine so that I can once again
get Aspell to compile with g++ 2.2.2
\end{itemize}

\chapter{Glossary and References}

\begin{description}
\item [affix]in grammar, a word element that, when added to a word, modifies its meaning
or function; prefix, infix, or suffix.
\item [Debian]A 100\% Open Source linux distribution \url{http://www.debian.org}
\item [DICT~protocol]A TCP transaction based query/response protocol that allows a
client to access dictionary definitions from a set of natural language dictionary
databases. \url{http://www.dict.org/}
\item [Gnome]A project to build a complete, user-friendly desktop based entirely on
free software. \url{http://www.gnome.org/}
\item [GTK+]A library for creating graphical user interfaces for the X Window System.
It is designed to be small, efficient, and flexible. \url{http://www.gtk.org/}
\item [GUI]Graphics User Interface
\item [Ispell.el]Emacs interface for ispell. \url{http://www.kdstevens.com/~stevens/ispell-page.html}
\item [Ispell]An international spell checker which is just about the only decent Open
Source spell checker out there. (except Aspell of course). \url{http://fmg-www.cs.ucla.edu/geoff/ispell.html}
\item [Ispell~-a]An Ispell mode that is designed to be used by other applications
though a pipe.
\item [KDE]A powerful graphical desktop environment for Unix workstations. \url{http://www.kde.org}
\item [Linux]A Open Source version of Unix which runs on many platforms. \url{http://www.linux.org/}
\item [\LyX{}]An What You See is What You Mean document editor for the X environment,
\url{http://www.lyx.org}
\item [Open~Source]Software where the source code is available for anyone to extend
or modify. \url{http://www.opensource.org/}
\item [Red~Hat]A commercial Linux distribution. \url{http://www.redhat.com}
\item [RPM]Red Hat's packing format also used by other Linux distributions.
\item [STL]Standard Temple Library. A C++ library of container classes, algorithms,
and iterators.
\item [SGI~STL]Silicon Graphics implantation of the STL. \url{http://www.sgi.com/Technology/STL/}
\item [STLPort]A port of SGI STL designed to run on compilers that don't support all
the latest features of C++. \url{http://corp.metabyte.com/~fbp/stl/}
\end{description}

\chapter{Copyright}

The library and the utility program is Copyrighted 1998 by Kevin Atkinson under
the LGPL for now. However the LGPL is generally not suitable for modern C++
as inline functions and templates tend to make it difficult to draw a line between
what is a program and what is a library. I am thinking about using a license
smiler to the The Blitz++ Artistic License.

The provided word list is extracted from the word lists provided with Ispell
thus it is distributed under the same terms of Ispell.

The three licenses follow:


\section{LGPL}

{\par\centering GNU LIBRARY GENERAL PUBLIC LICENSE \\
Version 2, June 1991\par}

Copyright (C) 1991 Free Software Foundation, Inc. 

\begin{quote}
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
\end{quote}
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.

{[}This is the first released version of the library GPL. It is numbered 2 because
it goes with version 2 of the ordinary GPL.{]}

{\par\centering Preamble\par}

The licenses for most software are designed to take away your freedom to share
and change it. By contrast, the GNU General Public Licenses are intended to
guarantee your freedom to share and change free software--to make sure the software
is free for all its users.

This license, the Library General Public License, applies to some specially
designated Free Software Foundation software, and to any other libraries whose
authors decide to use it. You can use it for your libraries, too.

When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for this service if you wish),
that you receive source code or can get it if you want it, that you can change
the software or use pieces of it in new free programs; and that you know you
can do these things.

To protect your rights, we need to make restrictions that forbid anyone to deny
you these rights or to ask you to surrender the rights. These restrictions translate
to certain responsibilities for you if you distribute copies of the library,
or if you modify it.

For example, if you distribute copies of the library, whether gratis or for
a fee, you must give the recipients all the rights that we gave you. You must
make sure that they, too, receive or can get the source code. If you link a
program with the library, you must provide complete object files to the recipients
so that they can relink them with the library, after making changes to the library
and recompiling it. And you must show them these terms so they know their rights.

Our method of protecting your rights has two steps: (1) copyright the library,
and (2) offer you this license which gives you legal permission to copy, distribute
and/or modify the library.

Also, for each distributor's protection, we want to make certain that everyone
understands that there is no warranty for this free library. If the library
is modified by someone else and passed on, we want its recipients to know that
what they have is not the original version, so that any problems introduced
by others will not reflect on the original authors' reputations.

Finally, any free program is threatened constantly by software patents. We wish
to avoid the danger that companies distributing free software will individually
obtain patent licenses, thus in effect transforming the program into proprietary
software. To prevent this, we have made it clear that any patent must be licensed
for everyone's free use or not licensed at all.

Most GNU software, including some libraries, is covered by the ordinary GNU
General Public License, which was designed for utility programs. This license,
the GNU Library General Public License, applies to certain designated libraries.
This license is quite different from the ordinary one; be sure to read it in
full, and don't assume that anything in it is the same as in the ordinary license.

The reason we have a separate public license for some libraries is that they
blur the distinction we usually make between modifying or adding to a program
and simply using it. Linking a program with a library, without changing the
library, is in some sense simply using the library, and is analogous to running
a utility program or application program. However, in a textual and legal sense,
the linked executable is a combined work, a derivative of the original library,
and the ordinary General Public License treats it as such.

Because of this blurred distinction, using the ordinary General Public License
for libraries did not effectively promote software sharing, because most developers
did not use the libraries. We concluded that weaker conditions might promote
sharing better.

However, unrestricted linking of non-free programs would deprive the users of
those programs of all benefit from the free status of the libraries themselves.
This Library General Public License is intended to permit developers of non-free
programs to use free libraries, while preserving your freedom as a user of such
programs to change the free libraries that are incorporated in them. (We have
not seen how to achieve this as regards changes in header files, but we have
achieved it as regards changes in the actual functions of the Library.) The
hope is that this will lead to faster development of free libraries.

The precise terms and conditions for copying, distribution and modification
follow. Pay close attention to the difference between a \char`\"{}work based
on the library\char`\"{} and a \char`\"{}work that uses the library\char`\"{}.
The former contains code derived from the library, while the latter only works
together with the library.

Note that it is possible for a library to be covered by the ordinary General
Public License rather than by this special one.

{\par\centering GNU LIBRARY GENERAL PUBLIC LICENSE\\
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\par}

0. This License Agreement applies to any software library which contains a notice
placed by the copyright holder or other authorized party saying it may be distributed
under the terms of this Library General Public License (also called \char`\"{}this
License\char`\"{}). Each licensee is addressed as \char`\"{}you\char`\"{}.

A \char`\"{}library\char`\"{} means a collection of software functions and/or
data prepared so as to be conveniently linked with application programs (which
use some of those functions and data) to form executables.

The \char`\"{}Library\char`\"{}, below, refers to any such software library
or work which has been distributed under these terms. A \char`\"{}work based
on the Library\char`\"{} means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a portion of
it, either verbatim or with modifications and/or translated straightforwardly
into another language. (Hereinafter, translation is included without limitation
in the term \char`\"{}modification\char`\"{}.)

\char`\"{}Source code\char`\"{} for a work means the preferred form of the work
for making modifications to it. For a library, complete source code means all
the source code for all modules it contains, plus any associated interface definition
files, plus the scripts used to control compilation and installation of the
library.

Activities other than copying, distribution and modification are not covered
by this License; they are outside its scope. The act of running a program using
the Library is not restricted, and output from such a program is covered only
if its contents constitute a work based on the Library (independent of the use
of the Library in a tool for writing it). Whether that is true depends on what
the Library does and what the program that uses the Library does. 1. You may
copy and distribute verbatim copies of the Library's complete source code as
you receive it, in any medium, provided that you conspicuously and appropriately
publish on each copy an appropriate copyright notice and disclaimer of warranty;
keep intact all the notices that refer to this License and to the absence of
any warranty; and distribute a copy of this License along with the Library.

You may charge a fee for the physical act of transferring a copy, and you may
at your option offer warranty protection in exchange for a fee.

2. You may modify your copy or copies of the Library or any portion of it, thus
forming a work based on the Library, and copy and distribute such modifications
or work under the terms of Section 1 above, provided that you also meet all
of these conditions:

\begin{LyXParagraphIndent}{0.5in}
a) The modified work must itself be a software library.

b) You must cause the files modified to carry prominent notices stating that
you changed the files and the date of any change.

c) You must cause the whole of the work to be licensed at no charge to all third
parties under the terms of this License.

d) If a facility in the modified Library refers to a function or a table of
data to be supplied by an application program that uses the facility, other
than as an argument passed when the facility is invoked, then you must make
a good faith effort to ensure that, in the event an application does not supply
such function or table, the facility still operates, and performs whatever part
of its purpose remains meaningful.

\end{LyXParagraphIndent}

(For example, a function in a library to compute square roots has a purpose
that is entirely well-defined independent of the application. Therefore, Subsection
2d requires that any application-supplied function or table used by this function
must be optional: if the application does not supply it, the square root function
must still compute square roots.)

These requirements apply to the modified work as a whole. If identifiable sections
of that work are not derived from the Library, and can be reasonably considered
independent and separate works in themselves, then this License, and its terms,
do not apply to those sections when you distribute them as separate works. But
when you distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of this License,
whose permissions for other licensees extend to the entire whole, and thus to
each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest your rights
to work written entirely by you; rather, the intent is to exercise the right
to control the distribution of derivative or collective works based on the Library.

In addition, mere aggregation of another work not based on the Library with
the Library (or with a work based on the Library) on a volume of a storage or
distribution medium does not bring the other work under the scope of this License.

3. You may opt to apply the terms of the ordinary GNU General Public License
instead of this License to a given copy of the Library. To do this, you must
alter all the notices that refer to this License, so that they refer to the
ordinary GNU General Public License, version 2, instead of to this License.
(If a newer version than version 2 of the ordinary GNU General Public License
has appeared, then you can specify that version instead if you wish.) Do not
make any other change in these notices.

Once this change is made in a given copy, it is irreversible for that copy,
so the ordinary GNU General Public License applies to all subsequent copies
and derivative works made from that copy.

This option is useful when you wish to copy part of the code of the Library
into a program that is not a library.

4. You may copy and distribute the Library (or a portion or derivative of it,
under Section 2) in object code or executable form under the terms of Sections
1 and 2 above provided that you accompany it with the complete corresponding
machine-readable source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange.

If distribution of object code is made by offering access to copy from a designated
place, then offering equivalent access to copy the source code from the same
place satisfies the requirement to distribute the source code, even though third
parties are not compelled to copy the source along with the object code.

5. A program that contains no derivative of any portion of the Library, but
is designed to work with the Library by being compiled or linked with it, is
called a \char`\"{}work that uses the Library\char`\"{}. Such a work, in isolation,
is not a derivative work of the Library, and therefore falls outside the scope
of this License.

However, linking a \char`\"{}work that uses the Library\char`\"{} with the Library
creates an executable that is a derivative of the Library (because it contains
portions of the Library), rather than a \char`\"{}work that uses the library\char`\"{}.
The executable is therefore covered by this License. Section 6 states terms
for distribution of such executables.

When a \char`\"{}work that uses the Library\char`\"{} uses material from a header
file that is part of the Library, the object code for the work may be a derivative
work of the Library even though the source code is not. Whether this is true
is especially significant if the work can be linked without the Library, or
if the work is itself a library. The threshold for this to be true is not precisely
defined by law.

If such an object file uses only numerical parameters, data structure layouts
and accessors, and small macros and small inline functions (ten lines or less
in length), then the use of the object file is unrestricted, regardless of whether
it is legally a derivative work. (Executables containing this object code plus
portions of the Library will still fall under Section 6.)

Otherwise, if the work is a derivative of the Library, you may distribute the
object code for the work under the terms of Section 6. Any executables containing
that work also fall under Section 6, whether or not they are linked directly
with the Library itself.

6. As an exception to the Sections above, you may also compile or link a \char`\"{}work
that uses the Library\char`\"{} with the Library to produce a work containing
portions of the Library, and distribute that work under terms of your choice,
provided that the terms permit modification of the work for the customer's own
use and reverse engineering for debugging such modifications.

You must give prominent notice with each copy of the work that the Library is
used in it and that the Library and its use are covered by this License. You
must supply a copy of this License. If the work during execution displays copyright
notices, you must include the copyright notice for the Library among them, as
well as a reference directing the user to the copy of this License. Also, you
must do one of these things:

\begin{LyXParagraphIndent}{0.5in}
a) Accompany the work with the complete corresponding machine-readable source
code for the Library including whatever changes were used in the work (which
must be distributed under Sections 1 and 2 above); and, if the work is an executable
linked with the Library, with the complete machine-readable \char`\"{}work that
uses the Library\char`\"{}, as object code and/or source code, so that the user
can modify the Library and then relink to produce a modified executable containing
the modified Library. (It is understood that the user who changes the contents
of definitions files in the Library will not necessarily be able to recompile
the application to use the modified definitions.)

b) Accompany the work with a written offer, valid for at least three years,
to give the same user the materials specified in Subsection 6a, above, for a
charge no more than the cost of performing this distribution.

c) If distribution of the work is made by offering access to copy from a designated
place, offer equivalent access to copy the above specified materials from the
same place.

d) Verify that the user has already received a copy of these materials or that
you have already sent this user a copy.

\end{LyXParagraphIndent}

For an executable, the required form of the \char`\"{}work that uses the Library\char`\"{}
must include any data and utility programs needed for reproducing the executable
from it. However, as a special exception, the source code distributed need not
include anything that is normally distributed (in either source or binary form)
with the major components (compiler, kernel, and so on) of the operating system
on which the executable runs, unless that component itself accompanies the executable.

It may happen that this requirement contradicts the license restrictions of
other proprietary libraries that do not normally accompany the operating system.
Such a contradiction means you cannot use both them and the Library together
in an executable that you distribute.

7. You may place library facilities that are a work based on the Library side-by-side
in a single library together with other library facilities not covered by this
License, and distribute such a combined library, provided that the separate
distribution of the work based on the Library and of the other library facilities
is otherwise permitted, and provided that you do these two things:

\begin{LyXParagraphIndent}{0.5in}
a) Accompany the combined library with a copy of the same work based on the
Library, uncombined with any other library facilities. This must be distributed
under the terms of the Sections above.

b) Give prominent notice with the combined library of the fact that part of
it is a work based on the Library, and explaining where to find the accompanying
uncombined form of the same work.

\end{LyXParagraphIndent}

8. You may not copy, modify, sublicense, link with, or distribute the Library
except as expressly provided under this License. Any attempt otherwise to copy,
modify, sublicense, link with, or distribute the Library is void, and will automatically
terminate your rights under this License. However, parties who have received
copies, or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.

9. You are not required to accept this License, since you have not signed it.
However, nothing else grants you permission to modify or distribute the Library
or its derivative works. These actions are prohibited by law if you do not accept
this License. Therefore, by modifying or distributing the Library (or any work
based on the Library), you indicate your acceptance of this License to do so,
and all its terms and conditions for copying, distributing or modifying the
Library or works based on it.

10. Each time you redistribute the Library (or any work based on the Library),
the recipient automatically receives a license from the original licensor to
copy, distribute, link with or modify the Library subject to these terms and
conditions. You may not impose any further restrictions on the recipients' exercise
of the rights granted herein. You are not responsible for enforcing compliance
by third parties to this License.

11. If, as a consequence of a court judgment or allegation of patent infringement
or for any other reason (not limited to patent issues), conditions are imposed
on you (whether by court order, agreement or otherwise) that contradict the
conditions of this License, they do not excuse you from the conditions of this
License. If you cannot distribute so as to satisfy simultaneously your obligations
under this License and any other pertinent obligations, then as a consequence
you may not distribute the Library at all. For example, if a patent license
would not permit royalty-free redistribution of the Library by all those who
receive copies directly or indirectly through you, then the only way you could
satisfy both it and this License would be to refrain entirely from distribution
of the Library.

If any portion of this section is held invalid or unenforceable under any particular
circumstance, the balance of the section is intended to apply, and the section
as a whole is intended to apply in other circumstances.

It is not the purpose of this section to induce you to infringe any patents
or other property right claims or to contest validity of any such claims; this
section has the sole purpose of protecting the integrity of the free software
distribution system which is implemented by public license practices. Many people
have made generous contributions to the wide range of software distributed through
that system in reliance on consistent application of that system; it is up to
the author/donor to decide if he or she is willing to distribute software through
any other system and a licensee cannot impose that choice.

This section is intended to make thoroughly clear what is believed to be a consequence
of the rest of this License.

12. If the distribution and/or use of the Library is restricted in certain countries
either by patents or by copyrighted interfaces, the original copyright holder
who places the Library under this License may add an explicit geographical distribution
limitation excluding those countries, so that distribution is permitted only
in or among countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.

13. The Free Software Foundation may publish revised and/or new versions of
the Library General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to address
new problems or concerns.

Each version is given a distinguishing version number. If the Library specifies
a version number of this License which applies to it and \char`\"{}any later
version\char`\"{}, you have the option of following the terms and conditions
either of that version or of any later version published by the Free Software
Foundation. If the Library does not specify a license version number, you may
choose any version ever published by the Free Software Foundation.

14. If you wish to incorporate parts of the Library into other free programs
whose distribution conditions are incompatible with these, write to the author
to ask for permission. For software which is copyrighted by the Free Software
Foundation, write to the Free Software Foundation; we sometimes make exceptions
for this. Our decision will be guided by the two goals of preserving the free
status of all derivatives of our free software and of promoting the sharing
and reuse of software generally.

{\par\centering NO WARRANTY\par}

15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY
\char`\"{}AS IS\char`\"{} WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE,
YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR
DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR
A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER
OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

{\par\centering END OF TERMS AND CONDITIONS\par}

{\par\centering How to Apply These Terms to Your New Libraries\par}

If you develop a new library, and you want it to be of the greatest possible
use to the public, we recommend making it free software that everyone can redistribute
and change. You can do so by permitting redistribution under these terms (or,
alternatively, under the terms of the ordinary General Public License).

To apply these terms, attach the following notices to the library. It is safest
to attach them to the start of each source file to most effectively convey the
exclusion of warranty; and each file should have at least the \char`\"{}copyright\char`\"{}
line and a pointer to where the full notice is found.

\begin{quote}
<one line to give the library's name and a brief idea of what it does.>\\
Copyright (C) <year> <name of author>

This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Library General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
later version.

This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
details.

You should have received a copy of the GNU Library General Public License along
with this library; if not, write to the Free Foundation, Inc., 59 Temple Place,
Suite 330, Boston, MA 02111-1307 USA
\end{quote}
Also add information on how to contact you by electronic and paper mail.

You should also get your employer (if you work as a programmer) or your school,
if any, to sign a \char`\"{}copyright disclaimer\char`\"{} for the library,
if necessary. Here is a sample; alter the names:

\begin{quote}
Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob'
(a library for tweaking knobs) written by James Random Hacker.

<signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice
\end{quote}
That's all there is to it!


\section{Ispell Copyright}

Copyright (c), 1983, by Pace Willisson

Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer. 

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution. 

3. All modifications to the source code must be clearly marked as such. Binary
redistributions based on modified source code must be clearly marked as modified
versions in the documentation and/or other materials provided with the distribution. 

4. All advertising materials mentioning features or use of this software must
display the following acknowledgment: 

\begin{quote}
This product includes software developed by Geoff Kuenning and other unpaid
contributors. 
\end{quote}
5. The name of Geoff Kuenning may not be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.


\section{The Blitz++ Artistic License }

(with thanks and apologies to authors of the Perl Artistic License)

Preamble

The intent of this document is to state the conditions under which Blitz++ may
be copied, such that the authors maintains some semblance of artistic control
over the development of the package, while giving the users of the package the
right to use and distribute Blitz++ in a more-or-less customary fashion, plus
the right to make reasonable modifications.

Definitions

Library refers to the collection of files distributed by the Copyright Holder,
and derivatives of that collection of files created through textual modification.

Standard Version refers to such a Library if it has not been modified, or has
been modified in accordance with the wishes of the Copyright Holder as specified
below.

Copyright Holder' is whoever is named in the copyright or copyrights for the
package.

You is you, if you're thinking about copying, modifying or distributing this
Library.

Freely Available means that no fee is charged for the item. It also means that
recipients of the item may redistribute it under the same conditions they received
it.

`Reasonable copying fee' is whatever you can justify on the basis of media cost,
duplication charges, time of people involved, and so on. (You will not be required
to justify it to the Copyright Holder, but only to the computing community at
large as a market that must bear the fee.)

1. You may make and give away verbatim copies of the Standard Version of this
Library without restriction, provided that you duplicate all of the original
copyright notices, this license, and associated disclaimers. 

2. The Standard Version of the Library may be distributed as part of a collection
of software, provided no more than a reasonable copying fee is charged for the
software collection.

3. You may apply bug fixes, portability fixes and other modifications derived
from the Public Domain or from the Copyright Holder. A Library modified in such
a way shall still be considered the Standard Version.

4. You may otherwise modify your copy of this Library in any way, provided that
you insert a prominent notice in each changed file stating how and when you
changed that file, and provided that you do at least ONE of the following:

a. place your modifications in the Public Domain or otherwise make them Freely
Available, such as by posting said modifications to the Blitz++ development
list, and allowing the Copyright Holder to include your modifications in the
Standard Version of the Library.

b. use the modified Library only within your corporation or organization. 

c. make other distribution arrangements with the Copyright Holder.

5. You may distribute programs which use this Library in object code or executable
form without restriction.

6. Any object code generated as a result of using this Library does not fall
under the copyright of this Library, but belongs to whomever generated it, and
may be sold commercially.

7. The name of the Copyright Holder or the Library may not be used to endorse
or promote products derived from this software without specific prior written
permission.

8. THIS PACKAGE IS PROVIDED AS IS AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND
FITNESS FOR A PARTICULAR PURPOSE.

\end{document}
