當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Search_Lucene_Analysis_Token::getPositionIncrement方法代碼示例

本文整理匯總了PHP中Zend_Search_Lucene_Analysis_Token::getPositionIncrement方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Search_Lucene_Analysis_Token::getPositionIncrement方法的具體用法?PHP Zend_Search_Lucene_Analysis_Token::getPositionIncrement怎麽用?PHP Zend_Search_Lucene_Analysis_Token::getPositionIncrement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Search_Lucene_Analysis_Token的用法示例。


在下文中一共展示了Zend_Search_Lucene_Analysis_Token::getPositionIncrement方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: normalize

 /**
  * @see Zend_Search_Lucene_Analysis_TokenFilter
  */
 public function normalize(Zend_Search_Lucene_Analysis_Token $srcToken)
 {
     $text = $this->stemmer->doStem($srcToken->getTermText());
     $newToken = new Zend_Search_Lucene_Analysis_Token($text, $srcToken->getStartOffset(), $srcToken->getEndOffset());
     $newToken->setPositionIncrement($srcToken->getPositionIncrement());
     return $newToken;
 }
開發者ID:nurfiantara,項目名稱:ehri-ica-atom,代碼行數:10,代碼來源:xfLuceneStemmerTokenFilter.class.php

示例2: normalize

 /**
  * Normalize Token or remove it (if null is returned).
  *
  * @param Zend_Search_Lucene_Analysis_Token $srcToken
  * @return Zend_Search_Lucene_Analysis_Token
  */
 public function normalize(Zend_Search_Lucene_Analysis_Token $srcToken)
 {
     // gets token text, invokes hook_search_preprocess().
     $processed_text = $srcToken->getTermText();
     search_invoke_preprocess($processed_text);
     // returns the new processed token
     $newToken = new Zend_Search_Lucene_Analysis_Token($processed_text, $srcToken->getStartOffset(), $srcToken->getEndOffset());
     $newToken->setPositionIncrement($srcToken->getPositionIncrement());
     return $newToken;
 }
開發者ID:sraj4,項目名稱:EthicsPublicHtmlProd,代碼行數:16,代碼來源:Drupal.php

示例3: normalize

    /**
     * Normalize Token or remove it (if null is returned)
     *
     * @param Zend_Search_Lucene_Analysis_Token $srcToken
     * @return Zend_Search_Lucene_Analysis_Token
     */
    public function normalize(Zend_Search_Lucene_Analysis_Token $srcToken)
    {
        $newToken = new Zend_Search_Lucene_Analysis_Token(
                                     strtolower( $srcToken->getTermText() ),
                                     $srcToken->getStartOffset(),
                                     $srcToken->getEndOffset());

        $newToken->setPositionIncrement($srcToken->getPositionIncrement());

        return $newToken;
    }
開發者ID:nhp,項目名稱:shopware-4,代碼行數:17,代碼來源:LowerCase.php

示例4: normalize

 /**
  * Normalize Token or remove it (if null is returned)
  *
  * @param Zend_Search_Lucene_Analysis_Token $srcToken
  * @return Zend_Search_Lucene_Analysis_Token
  */
 public function normalize(Zend_Search_Lucene_Analysis_Token $srcToken)
 {
     if ($this->mbString) {
         $value = mb_strtolower($srcToken->getTermText(), 'utf8');
     } else {
         $value = strtolower($srcToken->getTermText());
     }
     $newToken = new Zend_Search_Lucene_Analysis_Token($value, $srcToken->getStartOffset(), $srcToken->getEndOffset());
     $newToken->setPositionIncrement($srcToken->getPositionIncrement());
     return $newToken;
 }
開發者ID:palcoprincipal,項目名稱:sfLucenePlugin,代碼行數:17,代碼來源:sfLuceneLowerCaseFilter.class.php

示例5: normalize

 /**
  * Normalize Token or remove it (if null is returned)
  *
  * @param Zend_Search_Lucene_Analysis_Token $srcToken
  * @return Zend_Search_Lucene_Analysis_Token
  */
 public function normalize(Zend_Search_Lucene_Analysis_Token $po_srctoken)
 {
     $vo_lang_analyzer = new LanguageDetection();
     $vs_original_string = $po_srctoken->getTermText();
     $vs_lang_code = $vo_lang_analyzer->analyze($vs_original_string);
     /* stem text with respect to language that has been detected */
     $vo_stemmer = new SnoballStemmer();
     if ($vs_lang_code) {
         $vs_stemmed_string = $vo_stemmer->stem($vs_original_string, $vs_lang_code);
     } else {
         /* if language could not be detected, don't do any stemming at all */
         $vs_stemmed_string = $vs_original_string;
     }
     /* build new token to return */
     $vo_new_token = new Zend_Search_Lucene_Analysis_Token($vs_stemmed_string, $po_srctoken->getStartOffset(), $po_srctoken->getEndOffset());
     $vo_new_token->setPositionIncrement($po_srctoken->getPositionIncrement());
     return $vo_new_token;
 }
開發者ID:idiscussforum,項目名稱:providence,代碼行數:24,代碼來源:StemmingFilter.php

示例6: normalize

 /**
  * Normalize Token or remove it (if null is returned)
  *
  * @param Zend_Search_Lucene_Analysis_Token $srcToken
  * @return Zend_Search_Lucene_Analysis_Token
  */
 public function normalize(Zend_Search_Lucene_Analysis_Token $srcToken)
 {
     //iconv("utf-8", "us-ascii//TRANSLIT", $url); // TRANSLIT does the whole job
     // We could use also remove_accents() in uri.php
     // Problem: ñ -> n
     //$token = strtolower(iconv("utf-8", "us-ascii//TRANSLIT", $srcToken->getTermText()));
     $token = strtolower($srcToken->getTermText());
     if (strlen($token) < 2 || array_key_exists($token, $this->_stopSet)) {
         return null;
     }
     $newToken = new Zend_Search_Lucene_Analysis_Token($token, $srcToken->getStartOffset(), $srcToken->getEndOffset());
     $newToken->setPositionIncrement($srcToken->getPositionIncrement());
     return $newToken;
 }
開發者ID:brainsqueezer,項目名稱:fffff,代碼行數:20,代碼來源:lucene.php


注:本文中的Zend_Search_Lucene_Analysis_Token::getPositionIncrement方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。