本文整理汇总了C++中indri::api::Parameters::size方法的典型用法代码示例。如果您正苦于以下问题:C++ Parameters::size方法的具体用法?C++ Parameters::size怎么用?C++ Parameters::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类indri::api::Parameters
的用法示例。
在下文中一共展示了Parameters::size方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: push_queue
void push_queue( std::queue< query_t* >& q, indri::api::Parameters& queries,
int queryOffset ) {
for( size_t i=0; i<queries.size(); i++ ) {
std::string queryNumber;
std::string queryText;
std::string queryType = "indri";
if( queries[i].exists( "type" ) )
queryType = (std::string) queries[i]["type"];
if (queries[i].exists("text"))
queryText = (std::string) queries[i]["text"];
if( queries[i].exists( "number" ) ) {
queryNumber = (std::string) queries[i]["number"];
} else {
int thisQuery=queryOffset + int(i);
std::stringstream s;
s << thisQuery;
queryNumber = s.str();
}
if (queryText.size() == 0)
queryText = (std::string) queries[i];
// working set and RELFB docs go here.
// working set to restrict retrieval
std::vector<std::string> workingSet;
// Rel fb docs
std::vector<std::string> relFBDocs;
copy_parameters_to_string_vector( workingSet, queries[i], "workingSetDocno" );
copy_parameters_to_string_vector( relFBDocs, queries[i], "feedbackDocno" );
q.push( new query_t( i, queryNumber, queryText, queryType, workingSet, relFBDocs ) );
}
}
示例2: push_queue
void push_queue( std::queue< query_t* >& q, indri::api::Parameters& queries,
int queryOffset ) {
for( size_t i=0; i<queries.size(); i++ ) {
std::string queryNumber;
std::string queryText;
std::string queryType = "indri";
if( queries[i].exists( "type" ) )
queryType = (std::string) queries[i]["type"];
if( queries[i].exists( "number" ) ) {
queryText = (std::string) queries[i]["text"];
queryNumber = (std::string) queries[i]["number"];
} else {
queryText = (std::string) queries[i];
int thisQuery=queryOffset + int(i);
std::stringstream s;
s << thisQuery;
queryNumber = s.str();
}
q.push( new query_t( i, queryNumber, queryText, queryType ) );
}
}
示例3:
void indri::parse::StopperTransformation::read( indri::api::Parameters& stopwords ) {
for( unsigned int i=0; i < stopwords.size(); i++ ) {
_table.insert(strdup(((std::string) stopwords[i] ).c_str()));
}
}