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


C++ STRING::add_str_int方法代码示例

本文整理汇总了C++中STRING::add_str_int方法的典型用法代码示例。如果您正苦于以下问题:C++ STRING::add_str_int方法的具体用法?C++ STRING::add_str_int怎么用?C++ STRING::add_str_int使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在STRING的用法示例。


在下文中一共展示了STRING::add_str_int方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetValue

// Getter for the value.
STRING ParamContent::GetValue() const {
  STRING result;
  if (param_type_ == VT_INTEGER) {
    result.add_str_int("", *iIt);
  } else if (param_type_ == VT_BOOLEAN) {
    result.add_str_int("", *bIt);
  } else if (param_type_ == VT_DOUBLE) {
    result.add_str_double("", *dIt);
  } else if (param_type_ == VT_STRING) {
    if (STRING(*(sIt)).string() != nullptr) {
      result = sIt->string();
    } else {
      result = "Null";
    }
  }
  return result;
}
开发者ID:tesseract-ocr,项目名称:tesseract,代码行数:18,代码来源:paramsd.cpp

示例2: DebugStr

// Returns a string listing the classes/fonts in a shape.
STRING ShapeTable::DebugStr(int shape_id) const {
  if (shape_id < 0 || shape_id >= shape_table_.size())
    return STRING("INVALID_UNICHAR_ID");
  const Shape& shape = GetShape(shape_id);
  STRING result;
  result.add_str_int("Shape", shape_id);
  if (shape.size() > 100) {
    result.add_str_int(" Num unichars=", shape.size());
    return result;
  }
  for (int c = 0; c < shape.size(); ++c) {
    result.add_str_int(" c_id=", shape[c].unichar_id);
    result += "=";
    result += unicharset_->id_to_unichar(shape[c].unichar_id);
    if (shape.size() < 10) {
      result.add_str_int(", ", shape[c].font_ids.size());
      result += " fonts =";
      int num_fonts = shape[c].font_ids.size();
      if (num_fonts > 10) {
        result.add_str_int(" ", shape[c].font_ids[0]);
        result.add_str_int(" ... ", shape[c].font_ids[num_fonts - 1]);
      } else {
        for (int f = 0; f < num_fonts; ++f) {
          result.add_str_int(" ", shape[c].font_ids[f]);
        }
      }
    }
  }
  return result;
}
开发者ID:0xkasun,项目名称:Dummy_Tes,代码行数:31,代码来源:shapetable.cpp

示例3: SummaryStr

// Returns a debug string summarizing the table.
STRING ShapeTable::SummaryStr() const {
  int max_unichars = 0;
  int num_multi_shapes = 0;
  int num_master_shapes = 0;
  for (int s = 0; s < shape_table_.size(); ++s) {
    if (MasterDestinationIndex(s) != s) continue;
    ++num_master_shapes;
    int shape_size = GetShape(s).size();
    if (shape_size > 1)
      ++num_multi_shapes;
    if (shape_size > max_unichars)
      max_unichars = shape_size;
  }
  STRING result;
  result.add_str_int("Number of shapes = ", num_master_shapes);
  result.add_str_int(" max unichars = ", max_unichars);
  result.add_str_int(" number with multiple unichars = ", num_multi_shapes);
  return result;
}
开发者ID:0xkasun,项目名称:Dummy_Tes,代码行数:20,代码来源:shapetable.cpp

示例4: DebugWeights

// Sets up the network for training using the given weight_range.
void LSTM::DebugWeights() {
  for (int w = 0; w < WT_COUNT; ++w) {
    if (w == GFS && !Is2D()) continue;
    STRING msg = name_;
    msg.add_str_int(" Gate weights ", w);
    gate_weights_[w].Debug2D(msg.string());
  }
  if (softmax_ != NULL) {
    softmax_->DebugWeights();
  }
}
开发者ID:Using1174,项目名称:tesseract,代码行数:12,代码来源:lstm.cpp


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