/[drupal]/contributions/modules/porterstemmer/porterstemmer.module
ViewVC logotype

Diff of /contributions/modules/porterstemmer/porterstemmer.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.2.2.4, Wed Oct 21 23:39:54 2009 UTC revision 1.2.2.5, Wed Oct 21 23:47:22 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: porterstemmer.module,v 1.2.2.3 2009/10/08 16:22:10 jhodgdon Exp $  // $Id: porterstemmer.module,v 1.2.2.4 2009/10/21 23:39:54 jhodgdon Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 27  function porterstemmer_search_preprocess Line 27  function porterstemmer_search_preprocess
27    }    }
28    
29    // See if the PECL stemming package is installed and try to load it.    // See if the PECL stemming package is installed and try to load it.
30    
31    $has_pecl_stem = FALSE;    $has_pecl_stem = FALSE;
32    
33    if (extension_loaded( 'stem')) {    if (extension_loaded( 'stem')) {
34      $has_pecl_stem = TRUE;      $has_pecl_stem = TRUE;
35    }    }
# Line 47  function porterstemmer_search_preprocess Line 47  function porterstemmer_search_preprocess
47    $isword = !preg_match('/' . PORTERSTEMMER_BOUNDARY . '/', $words[0] );    $isword = !preg_match('/' . PORTERSTEMMER_BOUNDARY . '/', $words[0] );
48    foreach ($words as $k => $word) {    foreach ($words as $k => $word) {
49      if ($isword) {      if ($isword) {
50        if( $has_pecl_stem ) {        if ( $has_pecl_stem ) {
51          $words[$k] = stem_english($word);          $words[$k] = stem_english($word);
52        } else {        }
53          else {
54          $words[$k] = porterstemmer_stem($word);          $words[$k] = porterstemmer_stem($word);
55        }        }
56      }      }

Legend:
Removed from v.1.2.2.4  
changed lines
  Added in v.1.2.2.5

  ViewVC Help
Powered by ViewVC 1.1.2