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


C++ StringBuffer::appendFloat方法代码示例

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


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

示例1: explain

	void PhraseScorer::explain(int32_t _doc, Explanation* tfExplanation) {
		while (next() && doc() < _doc){
		}

		float_t phraseFreq = (doc() == _doc) ? freq : 0.0f;
		tfExplanation->setValue(getSimilarity()->tf(phraseFreq));

		StringBuffer buf;
		buf.append(_T("tf(phraseFreq="));
		buf.appendFloat(phraseFreq,2);
		buf.append(_T(")"));
		tfExplanation->setDescription(buf.getBuffer());
	}
开发者ID:FilipBE,项目名称:qtextended,代码行数:13,代码来源:PhraseScorer.cpp

示例2: toString

///todo: mem leaks
TCHAR* Explanation::toString(int32_t depth) {
 StringBuffer buffer;
 for (int32_t i = 0; i < depth; i++) {
   buffer.append(_T("  "));
 }
 buffer.appendFloat(getValue(),2);
 buffer.append(_T(" = "));
 buffer.append(getDescription());
 buffer.append(_T("\n"));

 for ( uint32_t j=0;j<details.size();j++ ){
   TCHAR* tmp = details[j]->toString(depth+1);
   buffer.append(tmp);
   _CLDELETE_CARRAY(tmp);
 }
 return buffer.toString();
}
开发者ID:FilipBE,项目名称:qtextended,代码行数:18,代码来源:Explanation.cpp

示例3: toString

 /** Prints a user-readable version of this query. */
 TCHAR* RangeQuery::toString(const TCHAR* field) const
 {
     StringBuffer buffer;
     if ( field==NULL || _tcscmp(getField(),field)!=0 )
     {
         buffer.append( getField() );
         buffer.append( _T(":"));
     }
     buffer.append(inclusive ? _T("[") : _T("{"));
     buffer.append(lowerTerm != NULL ? lowerTerm->text() : _T("NULL"));
     buffer.append(_T(" TO "));
     buffer.append(upperTerm != NULL ? upperTerm->text() : _T("NULL"));
     buffer.append(inclusive ? _T("]") : _T("}"));
     if (getBoost() != 1.0f)
     {
         buffer.append( _T("^"));
         buffer.appendFloat( getBoost(),1 );
     }
     return buffer.toString();
 }
开发者ID:Afreeca,项目名称:qt,代码行数:21,代码来源:RangeQuery.cpp

示例4: toHtml

///todo: mem leaks
TCHAR* Explanation::toHtml() {
 StringBuffer buffer;
 TCHAR* tmp;
 buffer.append(_T("<ul>\n"));

 buffer.append(_T("<li>"));
 buffer.appendFloat(getValue(),2);
 buffer.append(_T(" = "));
 
 buffer.append(getDescription());
 buffer.append(_T("</li>\n"));

 for ( uint32_t i=0;i<details.size();i++ ){
   tmp = details[i]->toHtml();
    buffer.append(tmp);
    _CLDELETE_CARRAY(tmp);
 }
 buffer.append(_T("</ul>\n"));

 return buffer.toString();
}
开发者ID:FilipBE,项目名称:qtextended,代码行数:22,代码来源:Explanation.cpp

示例5: if

UChar *BooleanQuery::toString(const UChar *field) const
{
	StringBuffer buffer;
	if (getBoost() != 1.0) {
		buffer.append(_T("("));
	}

	UChar *buf;
	BooleanClause* c;
	bool isBooleanQuery;
	size_t size = clauses.size();
	for (uint32_t i = 0 ; i < size; i++) {
		c = clauses[i];
		isBooleanQuery = c->query->instanceOf(BooleanQuery::getClassName());

		if (c->required) // AND clause
			buffer.append(_T("+"));
		else if (c->prohibited) // NOT clause
			buffer.append(_T("-"));

		if (isBooleanQuery) // wrap sub-bools in parens
			buffer.append(_T("("));

		buf = c->query->toString(field);
		buffer.append(buf);
		_CLDELETE_CARRAY(buf);

		if (isBooleanQuery) // wrap sub-bools in parens
			buffer.append(_T(")"));

		if (i != size - 1)
			buffer.append(_T(" "));

		if (getBoost() != 1.0) {
			buffer.append(_T(")^"));
			buffer.appendFloat(getBoost(), 1);
		}
	}
	return buffer.toString();
}
开发者ID:marsender,项目名称:atoll-digital-library,代码行数:40,代码来源:BooleanQuery.cpp

示例6: toString

  TCHAR* BooleanQuery::toString(const TCHAR* field) const{
    StringBuffer buffer;
    if (getBoost() != 1.0) {
      buffer.append(_T("("));
    }

    for (uint32_t i = 0 ; i < clauses.size(); i++) {
      BooleanClause* c = clauses[i];
      if (c->prohibited)
        buffer.append(_T("-"));
      else if (c->required)
        buffer.append(_T("+"));

      if ( c->query->instanceOf(BooleanQuery::getClassName()) ) {	  // wrap sub-bools in parens
        buffer.append(_T("("));

        TCHAR* buf = c->query->toString(field);
        buffer.append(buf);
        _CLDELETE_CARRAY( buf );

        buffer.append(_T(")"));
      } else {
        TCHAR* buf = c->query->toString(field);
        buffer.append(buf);
        _CLDELETE_CARRAY( buf );
      }
      if (i != clauses.size()-1)
        buffer.append(_T(" "));

      if (getBoost() != 1.0) {
         buffer.append(_T(")^"));
         buffer.appendFloat(getBoost(),1);
      }
    }
    return buffer.toString();
  }
开发者ID:Afreeca,项目名称:qt,代码行数:36,代码来源:BooleanQuery.cpp


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