当前位置: 首页>>代码示例>>PHP>>正文


PHP bitset_in函数代码示例

本文整理汇总了PHP中bitset_in函数的典型用法代码示例。如果您正苦于以下问题:PHP bitset_in函数的具体用法?PHP bitset_in怎么用?PHP bitset_in使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了bitset_in函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: isDeleted

    /**
     * Checks, that document is deleted
     *
     * @param integer
     * @return boolean
     */
    public function isDeleted($id)
    {
        if ($this->_deleted === null) {
            return false;
        }

        if (extension_loaded('bitset')) {
            return bitset_in($this->_deleted, $id);
        } else {
            return isset($this->_deleted[$id]);
        }
    }
开发者ID:realfluid,项目名称:umbaugh,代码行数:18,代码来源:SegmentInfo.php

示例2: score

 /**
  * Score specified document
  *
  * @param integer $docId
  * @param Zend_Search_Lucene $reader
  * @return float
  */
 public function score($docId, $reader)
 {
     if ($this->_docVector === null) {
         if (extension_loaded('bitset')) {
             $this->_docVector = bitset_from_array($reader->termDocs($this->_term));
         } else {
             $this->_docVector = array_flip($reader->termDocs($this->_term));
         }
         $this->_termPositions = $reader->termPositions($this->_term);
         $this->_initWeight($reader);
     }
     $match = extension_loaded('bitset') ? bitset_in($this->_docVector, $docId) : isset($this->_docVector[$docId]);
     if ($this->_sign && $match) {
         return $reader->getSimilarity()->tf(count($this->_termPositions[$docId])) * $this->_weight->getValue() * $reader->norm($docId, $this->_term->field);
     } else {
         return 0;
     }
 }
开发者ID:Nurudeen,项目名称:prado,代码行数:25,代码来源:Term.php

示例3: score

 /**
  * Score specified document
  *
  * @param integer $docId
  * @param ZSearch $reader
  * @return float
  */
 public function score($docId, $reader)
 {
     // optimize zero-term case
     if (count($this->_terms) == 0) {
         return 0;
     }
     if ($this->_resVector === null) {
         $this->_calculateResult($reader);
         $this->_initWeight($reader);
     }
     if (extension_loaded('bitset') ? bitset_in($this->_resVector, $docId) : isset($this->_resVector[$docId])) {
         if ($this->_slop == 0) {
             $freq = $this->_exactPhraseFreq($docId);
         } else {
             $freq = $this->_sloppyPhraseFreq($docId, $reader);
         }
         /*
                     return $reader->getSimilarity()->tf($freq) *
                            $this->_weight->getValue() *
                            $reader->norm($docId, reset($this->_terms)->field);
         */
         if ($freq != 0) {
             $tf = $reader->getSimilarity()->tf($freq);
             $weight = $this->_weight->getValue();
             $norm = $reader->norm($docId, reset($this->_terms)->field);
             return $tf * $weight * $norm;
         }
     } else {
         return 0;
     }
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:38,代码来源:ZSearchPhraseQuery.php

示例4: score

 /**
  * Score specified document
  *
  * @param integer $docId
  * @param Zend_Search_Lucene $reader
  * @return float
  */
 public function score($docId, $reader)
 {
     if ($this->_resVector === null) {
         if ($this->_signs === null) {
             $this->_calculateConjunctionResult($reader);
         } else {
             $this->_calculateNonConjunctionResult($reader);
         }
         $this->_initWeight($reader);
     }
     if (extension_loaded('bitset') ? bitset_in($this->_resVector, $docId) : isset($this->_resVector[$docId])) {
         if ($this->_signs === null) {
             return $this->_conjunctionScore($docId, $reader);
         } else {
             return $this->_nonConjunctionScore($docId, $reader);
         }
     } else {
         return 0;
     }
 }
开发者ID:Nurudeen,项目名称:prado,代码行数:27,代码来源:MultiTerm.php


注:本文中的bitset_in函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。