代码之家  ›  专栏  ›  技术社区  ›  Azeem Michael

c++搜索文本n布尔模式

  •  1
  • Azeem Michael  · 技术社区  · 15 年前


    1是否有一个c++库可以像mysql一样进行全文布尔搜索。例如。,
    假设我有:

    string text = "this is my phrase keywords test with boolean query."; 
    string booleanQuery = "\"my phrase\" boolean -test -\"keywords test\" OR ";
           booleanQuery += "\"boolean search\" -mysql -sql -java -php"b
    //where quotes ("") contain phrases, (-) is NOT keyword and OR is logical OR.


    2可以在文本中搜索短语吗。例如。,
    
    string text =//same as previous
    string keyword = "\"my phrase\"";
    //here what's the best way to search for my phrase in the text?
    3 回复  |  直到 15 年前
        1
  •  1
  •   Jerry Coffin    15 年前

    TR1有一个regex类(从 Boost::regex Boost::phoenix Boost::Spirit 也提供类似的功能,但是对于第一次尝试来说,Boost/TR1 regex类可能是更好的选择。

        2
  •  1
  •   Piotr Kalinowski    15 年前
        3
  •  0
  •   Quonux    15 年前