• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java PathHierarchyTokenizer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



PathHierarchyTokenizer类属于org.apache.lucene.analysis.path包,在下文中一共展示了PathHierarchyTokenizer类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: PathHierarchyTokenizerFactory

import org.apache.lucene.analysis.path.PathHierarchyTokenizer; //导入依赖的package包/类
public PathHierarchyTokenizerFactory(IndexSettings indexSettings, Environment environment, String name, Settings settings) {
    super(indexSettings, name, settings);
    bufferSize = settings.getAsInt("buffer_size", 1024);
    String delimiter = settings.get("delimiter");
    if (delimiter == null) {
        this.delimiter = PathHierarchyTokenizer.DEFAULT_DELIMITER;
    } else if (delimiter.length() > 1) {
        throw new IllegalArgumentException("delimiter can only be a one char value");
    } else {
        this.delimiter = delimiter.charAt(0);
    }

    String replacement = settings.get("replacement");
    if (replacement == null) {
        this.replacement = this.delimiter;
    } else if (replacement.length() > 1) {
        throw new IllegalArgumentException("replacement can only be a one char value");
    } else {
        this.replacement = replacement.charAt(0);
    }
    this.skip = settings.getAsInt("skip", PathHierarchyTokenizer.DEFAULT_SKIP);
    this.reverse =
        settings.getAsBooleanLenientForPreEs6Indices(indexSettings.getIndexVersionCreated(), "reverse", false, deprecationLogger);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:25,代码来源:PathHierarchyTokenizerFactory.java


示例2: PathHierarchyTokenizerFactory

import org.apache.lucene.analysis.path.PathHierarchyTokenizer; //导入依赖的package包/类
@Inject
public PathHierarchyTokenizerFactory(Index index, IndexSettingsService indexSettingsService, @Assisted String name, @Assisted Settings settings) {
    super(index, indexSettingsService.getSettings(), name, settings);
    bufferSize = settings.getAsInt("buffer_size", 1024);
    String delimiter = settings.get("delimiter");
    if (delimiter == null) {
        this.delimiter = PathHierarchyTokenizer.DEFAULT_DELIMITER;
    } else if (delimiter.length() > 1) {
        throw new IllegalArgumentException("delimiter can only be a one char value");
    } else {
        this.delimiter = delimiter.charAt(0);
    }

    String replacement = settings.get("replacement");
    if (replacement == null) {
        this.replacement = this.delimiter;
    } else if (replacement.length() > 1) {
        throw new IllegalArgumentException("replacement can only be a one char value");
    } else {
        this.replacement = replacement.charAt(0);
    }
    this.skip = settings.getAsInt("skip", PathHierarchyTokenizer.DEFAULT_SKIP);
    this.reverse = settings.getAsBoolean("reverse", false);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:25,代码来源:PathHierarchyTokenizerFactory.java


示例3: create

import org.apache.lucene.analysis.path.PathHierarchyTokenizer; //导入依赖的package包/类
@Override
public Tokenizer create() {
    if (reverse) {
        return new ReversePathHierarchyTokenizer(bufferSize, delimiter, replacement, skip);
    }
    return new PathHierarchyTokenizer(bufferSize, delimiter, replacement, skip);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:PathHierarchyTokenizerFactory.java


示例4: getPathTokens

import org.apache.lucene.analysis.path.PathHierarchyTokenizer; //导入依赖的package包/类
private List<Token> getPathTokens(String url, String partStringRaw, String partString) throws IOException {
    int start = getStartIndex(url, partStringRaw);
    if (!tokenizePath) {
        int end = getEndIndex(start, partStringRaw);
        return Collections.singletonList(new Token(partString, URLPart.PATH, start, end));
    }
    return tokenize(URLPart.PATH, addReader(new PathHierarchyTokenizer('/', '/'), new StringReader(partString)), start);
}
 
开发者ID:jlinn,项目名称:elasticsearch-analysis-url,代码行数:9,代码来源:URLTokenizer.java


示例5: create

import org.apache.lucene.analysis.path.PathHierarchyTokenizer; //导入依赖的package包/类
@Override
public Tokenizer create(Reader input) {
  if( reverse ) {
    return new ReversePathHierarchyTokenizer(input, delimiter, replacement, skip);
  }
  return new PathHierarchyTokenizer(input, delimiter, replacement, skip);
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:8,代码来源:PathHierarchyTokenizerFactory.java


示例6: init

import org.apache.lucene.analysis.path.PathHierarchyTokenizer; //导入依赖的package包/类
/**
 * Require a configured pattern
 */
@Override
public void init(Map<String,String> args){
  super.init( args );
  
  String v = args.get( "delimiter" );
  if( v != null ){
    if( v.length() != 1 ){
      throw new IllegalArgumentException("delimiter should be a char. \"" + v + "\" is invalid");
    }
    else{
      delimiter = v.charAt(0);
    }
  }
  else{
    delimiter = PathHierarchyTokenizer.DEFAULT_DELIMITER;
  }
  
  v = args.get( "replace" );
  if( v != null ){
    if( v.length() != 1 ){
      throw new IllegalArgumentException("replace should be a char. \"" + v + "\" is invalid");
    }
    else{
      replacement = v.charAt(0);
    }
  }
  else{
    replacement = delimiter;
  }
  
  v = args.get( "reverse" );
  if( v != null ){
    reverse = "true".equals( v );
  }

  v = args.get( "skip" );
  if( v != null ){
    skip = Integer.parseInt( v );
  }
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:44,代码来源:PathHierarchyTokenizerFactory.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java StandardStringDigester类代码示例发布时间:2022-05-23
下一篇:
Java IViewProvider类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap