net.sf.okapi.common.Util.strToInt()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(181)

本文整理了Java中net.sf.okapi.common.Util.strToInt()方法的一些代码示例,展示了Util.strToInt()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.strToInt()方法的具体详情如下:
包路径:net.sf.okapi.common.Util
类名称:Util
方法名:strToInt

Util.strToInt介绍

[英]Converts a string to an integer. If the conversion fails the method returns the given default value.
[中]将字符串转换为整数。如果转换失败,该方法将返回给定的默认值。

代码示例

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-mosestext

  1. if (m.group(1) != null) {
  2. int id = Util.strToInt(m.group(3), -1);
  3. code = new Code(TagType.OPENING, "g", m.group(1));
  4. code.setId(id);
  5. int id = Util.strToInt(m.group(3), -1);
  6. String name = m.group(1);
  7. if ( name.equals("bx") ) {

代码示例来源:origin: net.sf.okapi.lib/okapi-lib-translation

  1. if ( m.group(1) != null ) {
  2. id = Util.strToInt(m.group(3), -1);
  3. code = new Code(TagType.OPENING, "Xpt", null);
  4. code.setId(id);
  5. id = Util.strToInt(m.group(2).substring(1), -1);
  6. code.setId(id);
  7. codes.add(code);

代码示例来源:origin: net.sf.okapi.lib/okapi-lib-translation

  1. if ( m.group(1) != null ) {
  2. int id = Util.strToInt(m.group(3), -1);
  3. markers = String.format("%c%c", TextFragment.MARKER_OPENING,
  4. TextFragment.toChar(fragment.getIndex(id)));
  5. int id = Util.strToInt(m.group(2).substring(1), -1);
  6. markers = String.format("%c%c", TextFragment.MARKER_ISOLATED,
  7. TextFragment.toChar(fragment.getIndex(id)));

代码示例来源:origin: net.sf.okapi/okapi-core

  1. if (flagsChunk.startsWith("^")) {
  2. flags = Util.strToInt(flagsChunk.substring(1), 0);

相关文章