Example #1
0
 function __construct($k1 = null, $k2 = null, $k3 = null, $b = null, $min_normlen = null)
 {
     if (is_resource($k1) && get_resource_type($k1) === '_p_Xapian__BM25Weight') {
         $this->_cPtr = $k1;
         return;
     }
     switch (func_num_args()) {
         case 0:
             $this->_cPtr = new_BM25Weight();
             break;
         case 1:
             $this->_cPtr = new_BM25Weight($k1);
             break;
         case 2:
             $this->_cPtr = new_BM25Weight($k1, $k2);
             break;
         case 3:
             $this->_cPtr = new_BM25Weight($k1, $k2, $k3);
             break;
         case 4:
             $this->_cPtr = new_BM25Weight($k1, $k2, $k3, $b);
             break;
         default:
             $this->_cPtr = new_BM25Weight($k1, $k2, $k3, $b, $min_normlen);
     }
 }
Example #2
0
 function __construct($k1_ = null, $k2_ = null, $k3_ = null, $b_ = null, $min_normlen_ = null)
 {
     switch (func_num_args()) {
         case 0:
             $r = new_BM25Weight();
             break;
         case 1:
             $r = new_BM25Weight($k1_);
             break;
         case 2:
             $r = new_BM25Weight($k1_, $k2_);
             break;
         case 3:
             $r = new_BM25Weight($k1_, $k2_, $k3_);
             break;
         case 4:
             $r = new_BM25Weight($k1_, $k2_, $k3_, $b_);
             break;
         default:
             $r = new_BM25Weight($k1_, $k2_, $k3_, $b_, $min_normlen_);
     }
     $this->_cPtr = $r;
 }