PHP Classes
Icontem

File: sqlite_fulltextsearchex.class.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Setec Astronomy  >  SQLite Full Text Search  >  sqlite_fulltextsearchex.class.php  
File: sqlite_fulltextsearchex.class.php
Role: Class source
Content type: text/plain
Description: Extended class with exponential word prominence calculation
Class: SQLite Full Text Search
Add Full Text Search SQL commands to SQLite
 

Contents

Class file image Download
<?php 

require_once (dirname (__FILE__) . '/sqlite_fulltextsearch.class.php');

class 
sqlite_fulltextsearchex extends sqlite_fulltextsearch {

    var 
$striptags false;

    function 
sqlite_fulltextsearchex () {
        
parent::sqlite_fulltextsearch ();
        
$this->striptags false;
    }

    
/* override */
    
function prominence ($position$string_words_count$against_words_count) {
        
// exponential prominence
        
return (($position $position) / $string_words_count);
    }

    
/* override */
    
function wordspreparation (&$string, &$against) {
        if (
$this->striptags) {
            
$string preg_replace ('/<script.*?\>.*?<\/script>/si'' '$string); 
            
$string preg_replace ('/<style.*?\>.*?<\/style>/si'' '$string); 
            
$string preg_replace ('/<.*?\>/si'' '$string); 
            
$string html_entity_decode ($string);
        
            
$against preg_replace ('/<script.*?\>.*?<\/script>/si'' '$against); 
            
$against preg_replace ('/<style.*?\>.*?<\/style>/si'' '$against); 
            
$against preg_replace ('/<.*?\>/si'' '$against); 
            
$against html_entity_decode ($against);
        }
    }

}

?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products