Changeset 3047 in subversion


Ignore:
Timestamp:
Oct 19, 2009 3:27:16 AM (4 years ago)
Author:
alec
Message:
  • pspell checker: split text by [dot]+[non-word] instead of [dot] and don't check numeric strings
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/steps/mail/spell_pspell.inc

    r2788 r3047  
    4444 
    4545// tokenize 
    46 $words = preg_split('/[ !"#$%&()*+\\,-.\/\n:;<=>?@\[\]^_{|}]+/', $text, NULL,  PREG_SPLIT_NO_EMPTY | PREG_SPLIT_OFFSET_CAPTURE ); 
     46$words = preg_split('/[ !"#$%&()*+\\,\/\n:;<=>?@\[\]^_{|}-]+|\.[^\w]/', $text, NULL,  PREG_SPLIT_NO_EMPTY | PREG_SPLIT_OFFSET_CAPTURE ); 
    4747 
    4848// init spellchecker 
     
    5757    $pos  = $w[1] - $diff; 
    5858    $len  = mb_strlen($word); 
    59     if ($word && $plink && !pspell_check($plink, $word)) { 
     59    if ($word && $plink && preg_match('/[^0-9\.]/', $word) 
     60        && !pspell_check($plink, $word)) { 
    6061        $suggestions = pspell_suggest($plink, $word); 
    6162        if (sizeof($suggestions)>10) 
Note: See TracChangeset for help on using the changeset viewer.