
   #next previous up next
   
   next up previous contents 
   Next: 3. The Aspell utility Up: Aspell .28.3 alpha A Previous: 1.
   Introduction   Contents
   Subsections
     * 2.1 Requirements
     * 2.2 Obtaining
     * 2.3 Support
     * 2.4 Helping Out
     * 2.5 Compiling & Installing
          + 2.5.1 Generic Install Instructions
          + 2.5.2 Upgrading from version .28.2.1
          + 2.5.3 Upgrading from version .27.2
          + 2.5.4 Upgrading from version .25
          + 2.5.5 Upgrading from version .24
          + 2.5.6 Compiling with Egcs and Gcc 2.8
     * 2.6 Using as a replacement for Ispell
          + 2.6.1 Notes on the Learning from Users Mistakes feature
          + 2.6.2 Emacs and Xemacs Notes
          + 2.6.3 LyX Notes
          + 2.6.4 VIM Notes
     _________________________________________________________________
   
                              2. Getting Started
                                       
                               2.1 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 2.5.6 for what to do) That latest version of SGI's STL
   (http://www.sgi.com/Technology/STL/), version 3.11, fixes the bugs in
   rope and thus does not need to be fixed.
   
                                 2.2 Obtaining
                                       
   The latest version can always be found at Aspell's home page at
   http://metalab.unc.edu/kevina/aspell.
   
                                  2.3 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
   http://metalab.unc.edu/kevina/aspell.
   
                                2.4 Helping Out
                                       
   The easiest thing you can do to help out it is too send me your
   .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.
   
                          2.5 Compiling & Installing
                                       
2.5.1 Generic Install Instructions

   After you have read the sections below and have taken care of any
   special requirements for you system simply type
   
     ./configure && make
     
   or
   
     ./configure --disable-static && make
     
   to avoid making the static libraries on a system that supports shared
   libraries. For additional configure options type ./configure --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
   
     make install
     
   And thats all there is too it.
   
   If something goes wrong first see section 2.5.6 as there is a good
   change that that will fix your problem.
   
2.5.2 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.
   
2.5.3 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.
   
2.5.4 Upgrading from version .25

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

   Because the location of the main word list moved you should probably
   do a 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.
   
2.5.6 Compiling with Egcs and Gcc 2.8

   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
   
     patch < path/misc/stl_rope-30.diff
     
   (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 src/ in the
   aspell distribution and then type the command:
   
     patch < ../misc/stl_rope-30.diff
     
   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.
   
                     2.6 Using as a replacement for Ispell
                                       
   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:
   
     run-with-aspell «command»
     
   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.
   
2.6.1 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 3.1.1 for more information.
   
2.6.2 Emacs and Xemacs Notes

   The easiest way to use Aspell with Emacs or Xemacs is to add this
   line:
   
          (setq-default ispell-program-name "aspell")
          
   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:
   
          (setq-default ispell-extra-args '("-reverse"))
          
   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
   http://www.kdstevens.com/~stevens/ispell-page.html.
   
2.6.3 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 spell_command option in
   the lyxrc file or use the run-with-aspell utility.
   
2.6.4 VIM Notes

   (Note: Due to the change in beahvior of ``aspell check'' the following
   will not work without modifiction.)
   
   The following section was written by "R. Marc" <rmarc@copacetic.net>.
   
   Note: The following will not work with Vi as it relies on some Vim
   specific features.
   
   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.
   
     map aspell to ^T
     map \1 :let rm = Aspell_Write()<CR>
     map \2 :!aspell check %<CR>
     map \3 :call Aspell_Clean(rm)<CR><CR>
     map ^T \1\2\3
     
   ^T is a real control character in this example. In order to add that
   to your .vimrc using vim you type "<ctrl>-v<ctrl>-t". Macro's \1 and
   \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 "Hit RETURN to continue" prompts that
   Vim is so fond of displaying when various calls are made.
   
   Now about those functions. Here is what they look like:
   
          function Aspell_Write()
              if strlen(bufname('%'))
                  execute ":w!"
              else
                  execute ":w! /tmp/Aspellfunc.tmp"
                  let rm=1
                  return rm
              endif
          endf
          
          function Aspell_Clean(rm)
              execute ":e! %.checked"
              let tmp=expand("%")
              execute ":file #"
              execute ":w!"
              call delete(expand(tmp))
              if a:rm
                  call delete(expand("%"))
              endif
          endf
          
   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.
     _________________________________________________________________
   
   next up previous contents 
   Next: 3. The Aspell utility Up: Aspell .28.3 alpha A Previous: 1.
   Introduction   Contents
   
   
    Kevin Atkinson 1999-11-20
