[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/ -> aspell.php (summary)

Aspell interface This library gives full access to aspell's pipe interface. Optionally it provides some of the functions from the pspell PHP extension by wrapping them to calls to the aspell binary.

Author: Andreas Gohr
File Size: 322 lines (10 kb)
Included or required: 1 time
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Aspell:: (7 methods):
  Aspell()
  setMode()
  _prepareArgs()
  runAspell()
  execPipe()
  suggest()
  check()

Defines 7 functions

  pspell_config_create()
  pspell_config_mode()
  pspell_new_config()
  pspell_check()
  pspell_suggest()

Class: Aspell  - X-Ref

Class to interface aspell

Needs PHP >= 4.3.0
Aspell($language, $jargon=null, $encoding='iso8859-1')   X-Ref
Constructor. Works like pspell_config_create()

author: Andreas Gohr <andi@splitbrain.org>

setMode($mode)   X-Ref
Set the spelling mode like pspell_config_mode()

Mode can be PSPELL_FAST, PSPELL_NORMAL, PSPELL_BAD_SPELLER or ASPELL_ULTRA

author: Andreas Gohr <andi@splitbrain.org>

_prepareArgs()   X-Ref
Prepares the needed arguments for the call to the aspell binary

No need to call this directly

author: Andreas Gohr <andi@splitbrain.org>

runAspell($text,&$out,&$err,$specials=null)   X-Ref
Pipes a text to aspell

This opens a bidirectional pipe to the aspell binary, writes
the given text to STDIN and returns STDOUT and STDERR

You can give an array of special commands to be executed first
as $specials parameter. Data lines are escaped automatically

link: http://aspell.sf.net/man-html/Through-A-Pipe.html
author: Andreas Gohr <andi@splitbrain.org>

execPipe($command,$stdin,&$stdout,&$stderr)   X-Ref
Runs the given command with the given input on STDIN

STDOUT and STDERR are written to the given vars, the command's
exit code is returned. If the pip couldn't be opened null is returned

link: http://www.php.net/manual/en/function.proc-open.php#64116
author: <richard at 2006 dot atterer dot net>

suggest($word)   X-Ref
Checks a single word for correctness

returns: array of suggestions or true on correct spelling
author: Andreas Gohr <andi@splitbrain.org>

check($word)   X-Ref
Check if a word is mispelled like pspell_check

author: Andreas Gohr <andi@splitbrain.org>

Functions
Functions that are not part of a class:

pspell_config_create($language, $spelling=null, $jargon=null, $encoding='iso8859-1')   X-Ref
You can define PSPELL_COMP to use this class as drop in replacement
for the pspell extension


pspell_config_mode(&$config, $mode)   X-Ref
No description

pspell_new_config(&$config)   X-Ref
No description

pspell_check(&$dict,$word)   X-Ref
No description

pspell_suggest(&$dict, $word)   X-Ref
No description



Generated: Fri Nov 23 01:30:01 2007 Cross-referenced by PHPXref 0.7