本文整理汇总了C++中StringSet::addFromFile方法的典型用法代码示例。如果您正苦于以下问题:C++ StringSet::addFromFile方法的具体用法?C++ StringSet::addFromFile怎么用?C++ StringSet::addFromFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringSet
的用法示例。
在下文中一共展示了StringSet::addFromFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
StringSet s1;
s1.addFromFile("doc1.txt");
cout << "Doc1: " << s1 << endl;
StringSet s2;
s2.addFromFile("doc2.txt");
cout << "Doc2: "<< s2 << endl;
StringSet Union = s1 + s2;
cout << "Union: " << Union << endl;
StringSet query;
query.addFromFile("query.txt");
cout << "Query: " << query << endl;
cout << "Query size: " << query.numberOfStrings() << endl;
StringSet snidmengiQueryOgUnion = query * Union;
cout << "Found in Union: " << snidmengiQueryOgUnion.numberOfStrings() << endl;
cout << "Similarity to doc1: " << query.similarity(s1) << endl;
cout << "Similarity to doc2: " << query.similarity(s2);
return 0;
}