本文整理汇总了C++中FTSQuery::getNegatedPhr方法的典型用法代码示例。如果您正苦于以下问题:C++ FTSQuery::getNegatedPhr方法的具体用法?C++ FTSQuery::getNegatedPhr怎么用?C++ FTSQuery::getNegatedPhr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FTSQuery
的用法示例。
在下文中一共展示了FTSQuery::getNegatedPhr方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ASSERT
TEST(FTSQuery, CaseSensitiveNegativePhrases) {
FTSQuery q;
ASSERT(
q.parse("doing a -\"Phrase Test\" for fun", "english", true, TEXT_INDEX_VERSION_2).isOK());
ASSERT_EQUALS(0U, q.getPositivePhr().size());
ASSERT_EQUALS(1U, q.getNegatedPhr().size());
ASSERT_EQUALS("Phrase Test", q.getNegatedPhr()[0]);
}
示例2: TEST
TEST( FTSQuery, Basic1 ) {
FTSQuery q;
ASSERT( q.parse( "this is fun", "english" ).isOK() );
ASSERT_EQUALS( 1U, q.getTerms().size() );
ASSERT_EQUALS( "fun", q.getTerms()[0] );
ASSERT_EQUALS( 0U, q.getNegatedTerms().size() );
ASSERT_EQUALS( 0U, q.getPhr().size() );
ASSERT_EQUALS( 0U, q.getNegatedPhr().size() );
}
示例3: ASSERT
// Test textIndexVersion:1 query with language "invalid". No stemming will be performed,
// and no stopword list will be used.
TEST(FTSQuery, TextIndexVersion1LanguageInvalid) {
FTSQuery q;
ASSERT(q.parse("the running", "invalid", TEXT_INDEX_VERSION_1).isOK());
ASSERT_EQUALS(2U, q.getTerms().size());
ASSERT_EQUALS(1, std::count(q.getTerms().begin(), q.getTerms().end(), "the"));
ASSERT_EQUALS(1, std::count(q.getTerms().begin(), q.getTerms().end(), "running"));
ASSERT_EQUALS(0U, q.getNegatedTerms().size());
ASSERT_EQUALS(0U, q.getPhr().size());
ASSERT_EQUALS(0U, q.getNegatedPhr().size());
}