Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

fr:wiki:spell_checker [2018/04/24 18:18] (Version actuelle)
FabLac créée
Ligne 1: Ligne 1:
 +====== Vérificateur d'​orthographe ======
  
 +[[experimental]]
 +
 +DokuWiki a une option de vérification d'​orthographe. C'est une réécriture très proche de l'​outil de Garrison Locke [[http://​www.broken-notebook.com/​spell_checker/​index.php|AJAX spellchecker]].
 +
 +Voici les différences et les fonctionnalités:​
 +
 +  * Entièrement intégré à DokuWiki
 +  * Pas besoin de l'​extension pspell mais utilise le programme aspell à la place
 +  * Utilise [[http://​twilightuniverse.com/​2005/​05/​sack-of-ajax/​|SACK]] pour l'AJAX
 +  * Montre les problèmes et les suggestions en une seule passe
 +
 +
 +===== Appeler le vérificateur d'​orthographe =====
 +
 +Quand le vérificateur d'​orthographe est activé dans [[config:​spellchecker|config]] et que votre navigateur le supporte, vous avez un bouton supplémentaire [[Toolbar]]:​ {{http://​www.dokuwiki.org/​lib/​images/​toolbar/​spellcheck.png}} qui lance la vérification. Cela vérifiera votre texte et passera en //mode correction//​ avec tous les mots inconnus ou mal orthographiés soulignés en rouge. Vous pouvez cliquer sur ces mots pour avoir la liste des suggestions ou changer manuellement le mot. Lorsque vous avez fini de corriger votre texte, utilisez le bouton {{http://​www.dokuwiki.org/​lib/​images/​toolbar/​spellstop.png}} pour retourner en //mode édition//.
 +
 +Note: La vérification d'​orthographe peut prendre du temps, particulièrement lorsque votre texte est long ou contient beaucoup d'​erreurs.
 +
 +===== Besoins requis =====
 +
 +  * Pour utiliser le correcteur orthographique,​ vous devez avoir un navigateur compatible avec [[wp>​AJAX]]. Ces navigateurs sont compatibles:​
 +    * Firefox 1.0.4 ou plus récent.
 +    * Internet Explorer 6
 +    * Opera 8.0
 +    * Konqueror 3.3.2
 +    * Safari
 +  * Installer GNU [[http://​aspell.sf.net|aspell]] Version 0.60+ sur le serveur qui héberge le wiki 
 +  * PHP 4.3.0+ ​
 +  * Un dictionnaire aspell pour votre [[config:​lang|langue]] utilisé dans votre wiki
 +
 +===== Liste de mots personnelle =====
 +
 +Lors de la vérification orthographique,​ DokuWiki peut utiliser une liste personnelle complémentaire de mots. Le fichier doit être nommé ''​conf/​words.aspell''​ -- Voir le [[http://​aspell.net/​man-html/​Format-of-the-Personal-and-Replacement-Dictionaries.html#​Format-of-the-Personal-and-Replacement-Dictionaries|Manuel d'​Aspell]] pour le formatage du fichier.
 +
 +===== Installation =====
 +
 +==== Windows ====
 +
 +Note: if you are using PHP5 and IIS6, this cannot be made to work; anything returned from aspell is, for some reason, ignored.  ​
 +
 + - Use the nice point and click installers to install Aspell and at least one dictionary. If you're using an English dictionary you can download [[http://​www.nosq.com/​download/​aspell-0.60.3.exe|Aspell 0.60.3 for Win32]] from [[http://​www.nosq.com/​blog/​2005/​07/​aspell-0603-for-win32/​|No Status Quo]]. ​ If you're not using an English dictionary currently only 0.5.x pre-compiled Aspell binaries exist [[http://​aspell.net/​win32/​|here]];​ however these (seem to) work fine. ((In my setup it does not work, if the size of page to check is too large  --- // Konrad Bauckmeier 2005-10-17 15:38//))
 +  - Edit your dokuwiki.php config file (or better, edit/create local.php) to activate the spell checker *and* to give the path to Aspell, e.g, from my local.php:
 +
 +    $conf['​spellchecker'​]= 1;
 +    define ('​ASPELL_BIN','​C:​\apachefriends\xampp\Aspell\bin\aspell.exe'​);​
 +
 +You'll notice that the path to aspell.exe does not contain any spaces. If you have installed Aspell to '​Program Files',​ you will have to use the abbreviation that Windows generates, i.e. ''​%%'​C:​\PROGRA~1\Aspell\bin\aspell.exe'​%%''​ (This is the setting you want to use if you've used Aspell from [[http://​www.nosq.com|No Status Quo]].)
 +
 +You can list the abbreviated directory names by entering ''​dir /​x''​ at the command prompt - this will give you the Windows abbreviation for folders contained in that folder.
 +
 +----
 +When Using the Either of the ASPELL installs with version 2006-03-09 I just receive the error\\
 +<​code>​
 +"An error Occured while trying to run the spellchecker: ​
 +Could not run ASPELL '​C:​\PROGRA~1\Aspell\bin\aspell.exe'​." ​
 +</​code>​
 +I am using IIS 6 and PHP5. Any Ideas??
 +>It works with IIS 5 and PHP4, so it might simply be incompatible with the newer versions. I'd suggest googling the heck out of it.  --- //​[[david.mcneill@ge.com|DGM2]] 2006-04-25 19:12//
 +
 +I got the same problem. Try add **''​IUSR_''​ permissions to read and execute ''​cmd.exe''​**,​ located somewhere in ''​System32'',​ current windows directory. ​ Warning: this can reduce your system security (yet: who cares ;-) ?)
 +--- // Tomasz 2006-10-02 21:00//
 +
 +==== Debian ====
 +
 +Si vous utilisez Debian:
 +
 +  #> apt-get install aspell
 +
 +==== Gentoo ====
 +
 +If you are running Gentoo:
 +
 +  #> emerge -a aspell
 +
 +You also need to install a language package, if you don't wish to use English. Ex for danish:
 +
 +  #> emerge -a aspell-da
 +
 +For a complete list of available language packages use:
 +
 +  #> emerge -s aspell
 +
 +==== OpenBSD and FreeBSD ====
 +
 +For some reason //​dokuwiki//​ doesn'​t find aspell, so you need a include path in ''​dokuwiki.php''​.
 +
 +Note that for recent versions of DokuWiki ''​conf/​local.php''​ should be used for overriding the
 +configuration defaults stored in ''​conf/​dokuwiki.php''​.
 +
 +  define ('​ASPELL_BIN','/​usr/​local/​bin/​aspell'​);​
 +
 +Also, make sure that if you run Apache chrooted (default on OpenBSD) you installed aspell in chroot path :-)
 +
 +===== Comments/​Discussion =====
 +
 +It doesn'​t look like spellcheck.php is ever being called for me. I even changed the name of the file in the hopes of generating an error but none aee reported. I did check to see that this.run = function(){... was being called in spellcheck.js and it is. I also checked the value of this.handler in spellcheck.js and it looks good.
 +
 +--- // Dennis 2006-05-31 11:47//
 +
 +When I try to use the spellchecker,​ I get this error message:
 +
 +  An error occured while trying to run the spellchecker:​
 +  Aspell returned an error: sh: line 1: /aspell: No such file or directory
 +
 +My ''​aspell''​ is located in ''/​usr/​bin''​ and I added this line to my ''​local.protected.php''​ (I'm using [[config|Config plugin]]):
 +
 +  define ('​ASPELL_BIN','/​usr/​bin/​aspell'​);​
 +
 +I even tried to add it to ''​dokuwiki.php'',​ ''​spellcheck.php''​ and ''​aspell.php''​ before but it didn't help. Safe mode is turned off. What am I doing wrong?
 +
 +--- //​[[mehow@autocom.pl|Michał Tkacz]] 2005-11-22 14:10//\\
 +
 +Forget my above comment. Safe mode was turned **on** for that particular directory.
 +
 +--- //​[[mehow@autocom.pl|Michał Tkacz]] 2006-01-11 23:25//
 +
 +It's possible to use PHP's safe mode and DokuWiki'​s spell checker together by using the PHP option "​safe_mode_exec_dir"​.
 +
 +Let's assume you have enabled PHP's safe mode in your [[http://​httpd.apache.org|Apache]] configuration like this:
 +
 +<​code>​
 +   # make php more secure
 +   ​php_admin_value safe_mode 1
 +</​code>​
 +
 +Let's assume further, you're using [[wp>​Fedora_Core|Fedora Core]] as your operating system. To get DokuWiki'​s spell checker work, follow these steps (of course, you have to be root):
 +
 +0. Install aspell and additional dictionaries if necessary e. g.
 +
 +<​code>​
 +  yum -y install aspell aspell-de [...]
 +</​code>​
 +
 +1. Copy the aspell binary to your DokuWiki installation e. g.
 +
 +<​code>​
 +  cp /​usr/​bin/​aspell /​var/​www/​sites/​wiki.domain.example/​bin/​
 +</​code>​
 +
 +2. Change the owner of the (new) aspell binary e. g.
 +
 +<​code>​
 +  chown apache:​apache /​var/​www/​sites/​wiki.domain.example/​bin/​aspell
 +</​code>​
 +
 +3. Change your Apache configuration like this:
 +
 +<​code>​
 +   # make php more secure
 +   ​php_admin_value safe_mode 1
 +
 +   ​php_admin_value safe_mode_exec_dir "/​var/​www/​sites/​wiki.domain.example/​bin"​
 +</​code>​
 +
 +4. Execute "/​etc/​init.d/​httpd reload"​ and you're through.
 +
 +--- //​[[http://​www.chirado.de|Alexander Hoff / Chirado OHG]] 2006-03-11 18:40//
 +
 +To let your users edit the personal wordlist, you may do the following. Modify ''​lib/​exe/​spellcheck.php''​ by adding following line at the top of the file:
 +<​code>​require_once(DOKU_INC.'​inc/​pageutils.php'​);</​code>​
 +and replacing following lines:
 +<​code>​
 +//add personal dictionary
 +if(@file_exists(DOKU_INC.'​conf/​words.aspell'​)){
 +  $spell->​personal = DOKU_INC.'​conf/​words.aspell';​
 +}
 +</​code>​
 +with:
 +<​code>​
 +//add personal dictionary
 +if(@file_exists(wikiFN($conf['​personal'​]))) {
 +  $spell->​personal = wikiFN($conf['​personal'​]);​
 +}
 +</​code>​
 +Then add following line to your ''​conf/​local.php'':​
 +<​code>​$conf['​personal'​] = '​ignore-list';</​code>​
 +where ''​ignore-list''​ is the name of the page containing personal wordlist (it may include namespace).
 +Be aware that the [[http://​aspell.net/​man-html/​Format-of-the-Personal-and-Replacement-Dictionaries.html#​Format-of-the-Personal-and-Replacement-Dictionaries|format of the personal wordlist]] is quite restrictive.
 +
 +--- //​[[mehow@autocom.pl|Michał Tkacz]] 2006-01-14 13:07//
 +
 +I can't seem to get the spell checker to work.  I have aspell 60.3 installed, added the two lines to local.php as recommended,​ and even granted the IUSR_.. account read/​execute permissions to the aspell directory. ​ When you click on the spell check button, the text area window dims briefly, and the tool tip for the button indicates "No mistakes found"​. ​ Anyone else get this to work on Windows Server 2003 w/IIS 6?  I get the same results using both IE and Firefox. --- //​[[garyv@rochester.rr.com|GaryV]] 2006-06-25 11:30//
 +
 +This sounds like the same issue I mentioned above. I've spend many hours trying to figure this out.
 +--- // Dennis 2006-06-26 23:47//
 +
 +Try add **''​IUSR_''​ permissions to read and execute ''​cmd.exe''​**,​ located somewhere in ''​System32'',​ current windows directory. Warning: this can reduce your system security (yet: who cares ;-) ?)
 +--- // Tomasz 2006-10-02 11:00//
 +
 +===== Possible errors =====
 +
 +==== Aspell version ====
 +My system has a newly installed Aspell 0.60.4, and spell-check hasn't worked. I always got an error message, but without Aspell'​s error. I've modified the inc/​aspell.php:​\\
 +<code php>
 +            // close process
 +            $exitcode=proc_close($process); ​              //​Always got '​-1'​ :-o
 +            if ($err){ ​                                   //Modified rule
 +                //something went wrong
 +                $err = "​Aspell returned an error("​.ASPELL_BIN."​ exitcode: " . $exitcode . "​):​\n"​ . $err;
 +                return false;
 +            }
 +</​code>​
 +It's working fine in my system now with this modification.\\
 +
 +----
 +
 + --- //​[[peti@szladovics.hu|Péter Szládovics]] 2005-11-23 15:38//
 +
 +> Just to confirm this also fixed things for me, using aspell-0.60.4 on Linux (Fedora Core 4). Thx.  --- //​[[robert.meerman@gmail.com|Robert Meerman]] 2006-03-09 03:48//
 +
 + ===== Credits ===== 
 + --- //​[[philippe@bdsemin.com|Philippe LAPEYRIE]] 2006-05-18 23:42//\\
 + --- //​[[fyxx@monpoulpe.com|Kevin FAUCHON]] 2006-12-30 12:47//\\
  • fr/wiki/spell_checker.txt
  • Dernière modification: 2018/04/24 18:18
  • par FabLac