Skip to content
Snippets Groups Projects
Commit a2bd8ce7 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

Personal wordlist for spellchecker #488

This patch allows you to add a file named conf/words.aspell with your own
words you don't want the spellchecker to choke on.

Thanks to Steven Danz for code idea

darcs-hash:20050731172612-7ad00-60fb3f09589c4758f1093f532de9699beb048569.gz
parent 36df6fa3
No related branches found
No related tags found
No related merge requests found
personal_ws-1.1 en 4 utf-8
DokuWiki
Wiki
WikiWiki
Gohr
......@@ -41,7 +41,7 @@ All documentation and additional information besides the [[syntax|syntax descrip
2004-2005 (c) Andreas Gohr <andi@splitbrain.org>
The DokuWiki engine is licensend under [[http://www.gnu.org/licenses/gpl.html|GNU General Public License]] Version 2. If you use DokuWiki in your company, consider donating a few bucks to me via [[https://www.paypal.com/xclick/business=andi%40splitbrain.org&amp;item_name=DokuWiki+Donation&amp;no_shipping=1&amp;no_note=1&amp;tax=0&amp;currency_code=EUR&amp;lc=US|PayPal]] ;-).
The DokuWiki engine is licensed under [[http://www.gnu.org/licenses/gpl.html|GNU General Public License]] Version 2. If you use DokuWiki in your company, consider donating a few bucks to me via [[https://www.paypal.com/xclick/business=andi%40splitbrain.org&amp;item_name=DokuWiki+Donation&amp;no_shipping=1&amp;no_note=1&amp;tax=0&amp;currency_code=EUR&amp;lc=US|PayPal]] ;-).
The content published in the DokuWiki at http://www.splitbrain.org/dokuwiki/ is licensed under the [[http://creativecommons.org/licenses/by-nc-sa/2.0/|Creative Commons Attribution-NonCommercial-ShareAlike License]] Version 2.0. This is true for all content (files inside the ''data'' directory) distributed in the download tarball, too.
......
......@@ -70,6 +70,7 @@ if(defined('PSPELL_COMP')){
class Aspell{
var $language = null;
var $jargon = null;
var $personal = null;
var $encoding = 'iso8859-1';
var $mode = PSPELL_NORMAL;
var $version = 0;
......@@ -85,7 +86,6 @@ class Aspell{
$this->language = $language;
$this->jargon = $jargon;
$this->encoding = $encoding;
$this->_prepareArgs();
}
/**
......@@ -101,7 +101,6 @@ class Aspell{
}
$this->mode = $mode;
$this->_prepareArgs();
return $mode;
}
......@@ -125,6 +124,10 @@ class Aspell{
$this->args .= ' --jargon='.escapeshellarg($this->jargon);
}
if($this->personal != null){
$this->args .= ' --personal='.escapeshellarg($this->personal);
}
if($this->encoding != null){
$this->args .= ' --encoding='.escapeshellarg($this->encoding);
}
......@@ -160,6 +163,7 @@ class Aspell{
* @link http://aspell.sf.net/man-html/Through-A-Pipe.html
*/
function runAspell($text,&$out,&$err,$specials=null){
$this->_prepareArgs();
if(empty($text)) return true;
//prepare file descriptors
$descspec = array(
......
......@@ -58,6 +58,11 @@ header('Content-Type: text/plain; charset=utf-8');
$spell = new Aspell($conf['lang'],null,'utf-8');
$spell->setMode(PSPELL_FAST);
//add personal dictionary
if(@file_exists(DOKU_INC.'conf/words.aspell')){
$spell->personal = DOKU_INC.'conf/words.aspell';
}
//call the requested function
$call = 'spell_'.$_POST['call'];
if(function_exists($call)){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment