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


Java Transliterator.FORWARD属性代码示例

本文整理汇总了Java中com.ibm.icu.text.Transliterator.FORWARD属性的典型用法代码示例。如果您正苦于以下问题:Java Transliterator.FORWARD属性的具体用法?Java Transliterator.FORWARD怎么用?Java Transliterator.FORWARD使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.ibm.icu.text.Transliterator的用法示例。


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

示例1: init

@Override
public void init(Map<String,String> args) {
  super.init(args);
  String id = args.get("id");
  if (id == null) {
    throw new IllegalArgumentException("id is required.");
  }
  
  int dir;
  String direction = args.get("direction");
  if (direction == null || direction.equalsIgnoreCase("forward"))
    dir = Transliterator.FORWARD;
  else if (direction.equalsIgnoreCase("reverse"))
    dir = Transliterator.REVERSE;
  else
    throw new IllegalArgumentException("invalid direction: " + direction);
  
  transliterator = Transliterator.getInstance(id, dir);
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:19,代码来源:ICUTransformFilterFactory.java

示例2: IcuTransformTokenFilterFactory

public IcuTransformTokenFilterFactory(IndexSettings indexSettings, Environment environment, String name, Settings settings) {
    super(indexSettings, name, settings);
    this.id = settings.get("id", "Null");
    String s = settings.get("dir", "forward");
    this.dir = "forward".equals(s) ? Transliterator.FORWARD : Transliterator.REVERSE;
    this.transliterator = Transliterator.getInstance(id, dir);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:IcuTransformTokenFilterFactory.java

示例3: IcuTransformTokenFilterFactory

@Inject
public IcuTransformTokenFilterFactory(Index index,
                                      @IndexSettings Settings indexSettings,
                                      @Assisted String name,
                                      @Assisted Settings settings) {
    super(index, indexSettings, name, settings);
    String id = settings.get("id", "Null");
    String s = settings.get("dir", "forward");
    int dir = "forward".equals(s) ? Transliterator.FORWARD : Transliterator.REVERSE;
    this.transliterator = Transliterator.getInstance(id, dir);
}
 
开发者ID:jprante,项目名称:elasticsearch-icu,代码行数:11,代码来源:IcuTransformTokenFilterFactory.java

示例4: ICUTransformFilterFactory

/** Creates a new ICUTransformFilterFactory */
public ICUTransformFilterFactory(Map<String,String> args) {
  super(args);
  String id = require(args, "id");
  String direction = get(args, "direction", Arrays.asList("forward", "reverse"), "forward", false);
  int dir = "forward".equals(direction) ? Transliterator.FORWARD : Transliterator.REVERSE;
  transliterator = Transliterator.getInstance(id, dir);
  if (!args.isEmpty()) {
    throw new IllegalArgumentException("Unknown parameters: " + args);
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:11,代码来源:ICUTransformFilterFactory.java

示例5: IcuTransformTokenFilterFactory

public IcuTransformTokenFilterFactory(IndexSettings indexSettings, Environment environment, String name,
                                      Settings settings) {
    super(indexSettings, name, settings);
    String id = settings.get("id", "Null");
    String direction = settings.get("dir", "forward");
    int dir = "forward".equals(direction) ? Transliterator.FORWARD : Transliterator.REVERSE;
    String rules = settings.get("rules");
    this.transliterator = rules != null ?
            Transliterator.createFromRules(id, rules, dir) :
            Transliterator.getInstance(id, dir);
    String unicodeSetFilter = settings.get("unicodeSetFilter");
    if (unicodeSetFilter != null) {
        transliterator.setFilter(new UnicodeSet(unicodeSetFilter).freeze());
    }
}
 
开发者ID:jprante,项目名称:elasticsearch-plugin-bundle,代码行数:15,代码来源:IcuTransformTokenFilterFactory.java

示例6: IcuTransformTokenFilterFactory

@Inject
public IcuTransformTokenFilterFactory(Index index, @IndexSettings Settings indexSettings, @Assisted String name, @Assisted Settings settings) {
    super(index, indexSettings, name, settings);
    String id = settings.get("id", "Null");
    String s = settings.get("dir", "forward");
    int dir = "forward".equals(s) ? Transliterator.FORWARD : Transliterator.REVERSE;
    this.transliterator = Transliterator.getInstance(id, dir);
}
 
开发者ID:jprante,项目名称:elasticsearch-analysis-german,代码行数:8,代码来源:IcuTransformTokenFilterFactory.java


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