当前位置: 首页>>代码示例>>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;未经允许,请勿转载。