本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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());
}
}
示例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);
}