diff --git a/CMakeLists.txt b/CMakeLists.txt index c0adf0f..60cd6d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,12 +26,10 @@ if(simhash_BUILD_TESTS) set(CMAKE_CXX_STANDARD 11) endif() - ADD_SUBDIRECTORY(example) ADD_SUBDIRECTORY(test) ADD_SUBDIRECTORY(benchmark) ENABLE_TESTING() ADD_TEST(NAME ./test/test.run COMMAND ./test/test.run) ADD_TEST(NAME ./test/load_test COMMAND ./test/load_test) - ADD_TEST(NAME ./demo COMMAND ./demo) endif() diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt deleted file mode 100644 index 173e2d1..0000000 --- a/example/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}) - -ADD_EXECUTABLE(demo demo.cpp) diff --git a/example/demo.cpp b/example/demo.cpp deleted file mode 100644 index 82317bb..0000000 --- a/example/demo.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include -#include - -//this define can avoid some logs which you don't need to care about. -#define LOGGER_LEVEL LL_WARN - -#include "simhash/Simhasher.hpp" -using namespace simhash; - -int main(int argc, char** argv) -{ - Simhasher simhasher("../submodules/cppjieba/dict/jieba.dict.utf8", "../submodules/cppjieba/dict/hmm_model.utf8", "../submodules/cppjieba/dict/idf.utf8", "../submodules/cppjieba/dict/stop_words.utf8"); - string s("我是蓝翔技工拖拉机学院手扶拖拉机专业的。不用多久,我就会升职加薪,当上总经理,出任CEO,走上人生巅峰。"); - size_t topN = 5; - uint64_t u64 = 0; - vector > res; - simhasher.extract(s, res, topN); - simhasher.make(s, topN, u64); - cout<< "文本:\"" << s << "\"" << endl; - cout << "关键词序列是: " << res << endl; - cout<< "simhash值是: " << u64<