mirror of
https://github.com/yanyiwu/cppjieba.git
synced 2025-07-18 00:00:12 +08:00
modify some staff for install
This commit is contained in:
parent
81d9d191f8
commit
f2cc6c07e3
@ -1 +1,2 @@
|
|||||||
INSTALL(FILES start.sh stop.sh restart.sh DESTINATION /etc/init.d/CppJieba)
|
INSTALL(FILES start.sh stop.sh restart.sh DESTINATION /etc/init.d/CppJieba)
|
||||||
|
INSTALL(FILES cjseg.sh stop.sh restart.sh DESTINATION bin)
|
||||||
|
5
scripts/cjseg.sh
Executable file
5
scripts/cjseg.sh
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
if [ $# -lt 2 ]; then
|
||||||
|
echo "usage: $0 <file>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
cjsegment --dictpath /usr/share/CppJieba/dicts/jieba.dict.utf8 --modelpath /usr/share/CppJieba/dicts/hmm_model.utf8 $1
|
@ -3,19 +3,19 @@ SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
|
|||||||
|
|
||||||
SET(LIBCPPJIEBA_SRC HMMSegment.cpp MixSegment.cpp MPSegment.cpp Trie.cpp)
|
SET(LIBCPPJIEBA_SRC HMMSegment.cpp MixSegment.cpp MPSegment.cpp Trie.cpp)
|
||||||
ADD_LIBRARY(cppjieba STATIC ${LIBCPPJIEBA_SRC})
|
ADD_LIBRARY(cppjieba STATIC ${LIBCPPJIEBA_SRC})
|
||||||
ADD_EXECUTABLE(segment segment.cpp)
|
ADD_EXECUTABLE(cjsegment segment.cpp)
|
||||||
ADD_EXECUTABLE(server server.cpp)
|
ADD_EXECUTABLE(cjserver server.cpp)
|
||||||
|
|
||||||
LINK_DIRECTORIES(Husky)
|
LINK_DIRECTORIES(Husky)
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(segment cppjieba)
|
TARGET_LINK_LIBRARIES(cjsegment cppjieba)
|
||||||
TARGET_LINK_LIBRARIES(server cppjieba husky pthread)
|
TARGET_LINK_LIBRARIES(cjserver cppjieba husky pthread)
|
||||||
|
|
||||||
SET_TARGET_PROPERTIES(cppjieba PROPERTIES VERSION 1.2 SOVERSION 1)
|
SET_TARGET_PROPERTIES(cppjieba PROPERTIES VERSION 1.2 SOVERSION 1)
|
||||||
|
|
||||||
|
INSTALL(TARGETS cjsegment RUNTIME DESTINATION bin)
|
||||||
|
INSTALL(TARGETS cjserver RUNTIME DESTINATION bin)
|
||||||
INSTALL(TARGETS cppjieba ARCHIVE DESTINATION lib/CppJieba)
|
INSTALL(TARGETS cppjieba ARCHIVE DESTINATION lib/CppJieba)
|
||||||
INSTALL(TARGETS segment RUNTIME DESTINATION bin/CppJieba)
|
|
||||||
INSTALL(TARGETS server RUNTIME DESTINATION bin/CppJieba)
|
|
||||||
INSTALL(FILES ChineseFilter.hpp HMMSegment.h MPSegment.h structs.h Trie.h globals.h ISegment.hpp MixSegment.h SegmentBase.hpp TransCode.hpp DESTINATION include/CppJieba)
|
INSTALL(FILES ChineseFilter.hpp HMMSegment.h MPSegment.h structs.h Trie.h globals.h ISegment.hpp MixSegment.h SegmentBase.hpp TransCode.hpp DESTINATION include/CppJieba)
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ int main(int argc, char ** argv)
|
|||||||
{
|
{
|
||||||
cout<<"usage: \n\t"<<argv[0]<<" [options] <filename>\n"
|
cout<<"usage: \n\t"<<argv[0]<<" [options] <filename>\n"
|
||||||
<<"options:\n"
|
<<"options:\n"
|
||||||
<<"\t--algorithm\tSupported methods are [cutDAG, cutHMM, cutMix] for now. \n\t\t\tIf not specified, the default is cutDAG\n"
|
<<"\t--algorithm\tSupported methods are [cutDAG, cutHMM, cutMix] for now. \n\t\t\tIf not specified, the default is cutMix\n"
|
||||||
<<"\t--dictpath\tsee example\n"
|
<<"\t--dictpath\tsee example\n"
|
||||||
<<"\t--modelpath\tsee example\n"
|
<<"\t--modelpath\tsee example\n"
|
||||||
<<"example:\n"
|
<<"example:\n"
|
||||||
@ -56,18 +56,7 @@ int main(int argc, char ** argv)
|
|||||||
cut(&seg, arg[1].c_str());
|
cut(&seg, arg[1].c_str());
|
||||||
seg.dispose();
|
seg.dispose();
|
||||||
}
|
}
|
||||||
else if("cutMix" == algorithm)
|
else if("cutDAG" == algorithm)
|
||||||
{
|
|
||||||
MixSegment seg;
|
|
||||||
if(!seg.init(dictPath.c_str(), modelPath.c_str()))
|
|
||||||
{
|
|
||||||
cout<<"seg init failed."<<endl;
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
cut(&seg, arg[1].c_str());
|
|
||||||
seg.dispose();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
MPSegment seg;
|
MPSegment seg;
|
||||||
if(!seg.init(dictPath.c_str()))
|
if(!seg.init(dictPath.c_str()))
|
||||||
@ -78,5 +67,16 @@ int main(int argc, char ** argv)
|
|||||||
cut(&seg, arg[1].c_str());
|
cut(&seg, arg[1].c_str());
|
||||||
seg.dispose();
|
seg.dispose();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MixSegment seg;
|
||||||
|
if(!seg.init(dictPath.c_str(), modelPath.c_str()))
|
||||||
|
{
|
||||||
|
cout<<"seg init failed."<<endl;
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
cut(&seg, arg[1].c_str());
|
||||||
|
seg.dispose();
|
||||||
|
}
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -4,3 +4,6 @@
|
|||||||
小明硕士毕业于中国科学院计算所,后在日本京都大学深造
|
小明硕士毕业于中国科学院计算所,后在日本京都大学深造
|
||||||
我来自北京邮电大学。。。学号091111xx。。。
|
我来自北京邮电大学。。。学号091111xx。。。
|
||||||
来这里看看别人正在搜索什么吧
|
来这里看看别人正在搜索什么吧
|
||||||
|
我来到南京市长江大桥
|
||||||
|
请在一米线外等候
|
||||||
|
人事处女干事
|
||||||
|
Loading…
x
Reference in New Issue
Block a user