From 21628b4f821db34c9b5e645bdf650791f19f3c68 Mon Sep 17 00:00:00 2001 From: ruoshui1126 Date: Wed, 12 Nov 2014 05:22:37 +0800 Subject: [PATCH] adaptation for windows --- examples/Makefile | 45 +++++++++++++++++++++++++++++++++++++ examples/cws | Bin 0 -> 13150 bytes {test => examples}/cws.cpp | 2 +- examples/ner | Bin 0 -> 17108 bytes {test => examples}/ner.cpp | 2 +- examples/par | Bin 0 -> 16314 bytes {test => examples}/par.cpp | 2 +- examples/pos | Bin 0 -> 15913 bytes {test => examples}/pos.cpp | 2 +- examples/srl | Bin 0 -> 20917 bytes {test => examples}/srl.cpp | 2 +- test/CMakeLists.txt | 38 ++++++++++++++++++------------- test/cws_cmdline.cpp | 13 +++-------- test/multi_cws_cmdline.cpp | 14 ++++-------- test/multi_pos_cmdline.cpp | 13 +++-------- test/par_cmdline.cpp | 15 ++++--------- test/pos_cmdline.cpp | 13 +++-------- 17 files changed, 90 insertions(+), 71 deletions(-) create mode 100644 examples/Makefile create mode 100755 examples/cws rename {test => examples}/cws.cpp (96%) create mode 100755 examples/ner rename {test => examples}/ner.cpp (97%) create mode 100755 examples/par rename {test => examples}/par.cpp (96%) create mode 100755 examples/pos rename {test => examples}/pos.cpp (96%) create mode 100755 examples/srl rename {test => examples}/srl.cpp (98%) diff --git a/examples/Makefile b/examples/Makefile new file mode 100644 index 000000000..392e30e4d --- /dev/null +++ b/examples/Makefile @@ -0,0 +1,45 @@ +################################################# +# Example for call LTP libraries under UNIX # +################################################# +cc=g++ +ccflags=-O2 +all: cws \ + pos \ + par \ + ner \ + srl + +cws: cws.cpp + ${cc} ${ccflags} -o cws cws.cpp -I./ \ + -I../include/ \ + -I../thirdparty/boost/include \ + -L../lib/ -lsegmentor -lboost_regex + +pos: pos.cpp + ${cc} ${ccflags} -o pos pos.cpp -I./ \ + -I../include/ \ + -L../lib/ -lpostagger + +ner: ner.cpp + ${cc} ${ccflags} -o ner ner.cpp -I./ \ + -I../include \ + -L../lib/ -lner + +par: par.cpp + ${cc} ${ccflags} -o par par.cpp -I./ \ + -I../include \ + -L../lib -lparser + +srl: srl.cpp + ${cc} ${ccflags} -o srl srl.cpp -I./ \ + -I../include \ + -L../lib -lsrl + +.PHONY: clean + +clean: + rm cws + rm pos + rm ner + rm par + rm srl diff --git a/examples/cws b/examples/cws new file mode 100755 index 0000000000000000000000000000000000000000..01177fc5f61ff899823bcc974dd7549f07d11264 GIT binary patch literal 13150 zcmcgy4|G)3nZGlWK*Tr+h#3ATPaG6#8D~O(;97n82XAzMKtiPoz6>)%GVWw%oOyvj zt)c;s(-6q2r_xp{wYJCFZp*scJ*X{&Mx}es)SH25(_uY5z z-oDA>>@3Wt4Xcz^R%ULFbtqlT=zrl-e6hs>qsj{-q`> zDPsx;NRMn)M7eTl2gfBH5q8uUD_3|q!KBwJ^jd|Uq$9#GNoD`2Z}iL)_0Dsu;D}d= z2&={@9}D2Eqeg`Cb(fG7QMH6NbB-}drQUkzk)5A5NjtBN$F?r7yEYzK5|1T%dYAOp zFJH2}&YMYkYq|Z^sF1q2dhJGDwH%KNL_^a-J$Po~nUALm&jLIO9_qpscrL_KgXc;- zbMRb_$Bl=U)C@e-hs*GMQkrTJpuUQsWn{}VJT!G=ZzUdUqO~>)kL)v*U4&;g9_pKz zTI3kJ7!UPHt~vyW1@^bV3U7R6tqEp0aj#3waO8>Zw`R7+POr?Pl3E5@>X)c zXm``R4lB%-pxrBAzanr&l)ho>Z@0kz0hH`X3487ocxIA*)rfvQCFXIza5zgKZ?*q~ zsAr?C-A&*ry@F>3c4_J&mDsTa|C5P!c1IINGEHvB=kh;$WoG~KdYpx+=Ij<~JhpwgkK7EZIiDry+a%T(73kAYtO`8$V1lkP0Kim~c z>qa^hGcqV?f${#OTSJ*xSVtr1dv_q*uD7%;)6sEWZE|U<$7rE^B;HD9Lu0wF8(rz- z4t;AVqK88n!|YC`$=?DsYpZqPXgbaGKsy!Dof$h^DVTmds!bGSRvK=F02@@Z_>> z@t#ZI6u=jCU(R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w4-Q?Y0)v`II* z^)LlDWtfa)vOu~XN$Q>PFMs?DeY-l+sw^bwV`26i!M1bN9M;`;a5XuD?2jYa4JPXL@N;#mFPjJPj9exg-(}A zU7HTux+QSTRx-X( z3Y4?e{ucuT|El0cdjspR1|qS9-jj)9^}#3}bZD2FGy+k#E+f*OG}_WurH*JvxiLwv zBu3IE%ZDCud^T8*WRg0zXoSKgO)n&OdT~9QdymF?Trg^L?f-QoVu^hS;wuROgbl?2 z$Pz(&K;b8b$jSi3aEM1U^58-~bA0S43EeDhlCNfXh|eB5YOiO)k>$~sG7NHjpsA`_ a;vP$bE>XP*lcXMrAluS5P4CJl_J05hIyEl< literal 0 HcmV?d00001 diff --git a/test/cws.cpp b/examples/cws.cpp similarity index 96% rename from test/cws.cpp rename to examples/cws.cpp index 6a9355c54..5d2506148 100644 --- a/test/cws.cpp +++ b/examples/cws.cpp @@ -1,6 +1,6 @@ #include #include -#include "segment_dll.h" +#include "ltp/segment_dll.h" int main(int argc, char * argv[]) { if (argc < 2) { diff --git a/examples/ner b/examples/ner new file mode 100755 index 0000000000000000000000000000000000000000..24d90ad03754c3cf6f04fc932e5d75522caacd97 GIT binary patch literal 17108 zcmcgz3v^V~x!#${KtPy@NCh7)gA7k4O(0^ZRwt0?84Vaoun6MGkPIZ6S2Gg`YAYIo zOvgyBwN+bhtG(*A-rCaoSl}ZBBZ98m8ns&6>w~L8&j?nqiddE0@7rhZ+G}7QT>9dY01Dv`s9FtD$}*Mj zNz^c(Gf}djVVTji(uRemTJI9*v7TQx>3V*>zHY^w!mroY%&f0#Y;Bv_Ry1ekoWi_# zQ{F6D|6CYk6E9e}Sen-TF+w?-40^iCe+6``%Acs{S3#*iP4OgbS^)o(@gIr59%K5V zy&3pV!JjE)6M1C&I1Nv5V3UxaivKu;v0f+PKSA+dL%OOm-lxL8m$8FH$9iE-5fI{XJ!-bt1Nch=`} zRrrYu=e%X|!hTTZG7m*AdCoDW6#h>8adkrXxa5~fX(7tc4)$l?v?__{{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@C*d+so(FOng?&^aAkXJ>#(tsgk@t zyza8IOci`i`61$A#-akW!xt>hG*RLw2!6=sOnJaL&-qy%Q%W9%I2X7a7qwn>DEu-h zuNV*=Z}X^<=kskQ`zXX~z=w)6v0QfUky^NxVslHsd@sN>LLSj3;Lh>-xx({-2UXrl z&I3MF98QVL&IF|tb>T^ce+T$baX7zl$@4nF^q~u1X~Sa7@S*#2Ch(#9rw};X8&uaL z9fz}6;mWM&QW<`k>g=DL3SZ~KbsWwe6305P#*6P7n0_MhA@)nv(fWEvNRFs(NyHPa zD_7gfES7x`#Qdcixmyz1s=VO~&n@x0*STe|rC^D9abnNmEjtd!l9sVpU(sxtBkVh#tki~~?IC6_HMUJ#it z_}Fcr7Bb?ZI^L?Ho|Nd&;XC25jJL33Ea3A?gkCWk$ffpoVrDX=^ANA0Y9?cvR0v8q z>zZ-a3HGEp^OjF4H+rseR1&HJ8aR4$MPu7tAtC z>@#O9+0eq(Q9JTXE?r+3J1Lg|h}pqyM=b>QBsoUBUZ!ukB*4-?9xmvz vR>oMrz9bWBF; literal 0 HcmV?d00001 diff --git a/test/ner.cpp b/examples/ner.cpp similarity index 97% rename from test/ner.cpp rename to examples/ner.cpp index c1c3589e1..14aa4542e 100644 --- a/test/ner.cpp +++ b/examples/ner.cpp @@ -1,7 +1,7 @@ #include #include -#include "ner_dll.h" +#include "ltp/ner_dll.h" int main(int argc, char * argv[]) { if (argc < 2) { diff --git a/examples/par b/examples/par new file mode 100755 index 0000000000000000000000000000000000000000..38c4d535eb3253dd3e5e419e027a48dc2e06fea8 GIT binary patch literal 16314 zcmcIr4|r6?wV&P1Lipn*fL2t5gE=vhR21&TQ`9 z1nbw=H~H?KIlnpQ%$YND=T7dOxve^Qt=(p0GTGTz7;*jyehwMGj1A7@tiZ}yKJ&Aw z>@qeAh!dBemk>2_lJ*MIlI9CJ2WTGU?E!Ai=Q zn**drzLtyf^64RtOUlS0q#EuN<=phc-6OpQq1PbvBt1@sktCJvBQtbO5$&5|_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4$5C;z@S$TsS(wBB#M}b-2?+I~HztGn?H}oU*Bt3;9vwo2`#D$BzhK}^p;D+j# z`~Wg!OSWHrcP|(Ea{iU_R(oeqK=oUb)bF(vSY_!pm35m%2SxpVHiO7p^@+DzWQc8_ zYk>UACbD!p(z8OwO^(Ykz(%V71PLSkmv{~s-0=D(J`$yU8_ez>R^))k@;PZPbifn8 z-EW3?-hmljKG)2J4vb3qyvoH#G5H+I#Ybn?-MM%^lh2J@9MO@_15<%xgne*S?7$O3 z&fg|+;N!FV&~x$O`%DcxF3g{PvnbCyuya?=kLE%LW(hg(<>C`CkNM3I&pYs@LC#a= zLI<0Kc_(Csg#3k=Pe#Ho!hZ6R@Gs#09|^xW`+pWQB?q38^1d~}h}+P<(OmpeGt2YF zeK4LiS=RYa+HFw1~h6>y3Jy*s5O<4{W(`$Se| z@xSpr_|0U;K772JrDjGaGQPjeeo7>_Xy*hKJZSYhKeNj#gDV+ z;#Y|B85|$aXmf%mHX(gwBU5VQL3`w8w{9j06qib&AN|%tH7=M=#L6J z)_wHv0e1_VWp zQ=)gplzstxf_*ZhZ8hd}$YN)mD14LTP4jIb#wDeXg&q2!VNMP>U~bnmQ8*3w1p6em zc6zS-94?Rj_+s3qg#2RQXl*!d4T9v~stIQS+ z?PpiDW;H@P+7nD}UpGOjTHmT}Zff0#^920u6rDF{pNYps!(bwYoI8YDq;4_)L1-9IW-)QhquXn z+$z1!6AVVzJ+zA2txj0IZ61ki^*HKU^n! zbS39Niut6iehn~&OzEF1}E59a)x$8d7( z^3yNIK`qR3#yO#3ceXLm&U5t1V$XW!YnZX&@iWdr$&)$5k6&3#;Eb51&YYt`C=-Wy Vs2jyWvRnn@p(2LZ-+dVFe*x0oe>eaD literal 0 HcmV?d00001 diff --git a/test/par.cpp b/examples/par.cpp similarity index 96% rename from test/par.cpp rename to examples/par.cpp index 02ed9dcf2..8e22a0635 100644 --- a/test/par.cpp +++ b/examples/par.cpp @@ -1,7 +1,7 @@ #include #include -#include "parser_dll.h" +#include "ltp/parser_dll.h" int main(int argc, char * argv[]) { if (argc < 2) { diff --git a/examples/pos b/examples/pos new file mode 100755 index 0000000000000000000000000000000000000000..2a0e919ed4c2faed779404f6429d970ebe13314e GIT binary patch literal 15913 zcmeHOeRx#WnLjg=fe1J=fNi5t8Iys6=r{=x62&?piQJI^A_EW%{`-im=M`j zK8TC-KZHvLKO!H%brG)FxMUwwSpi&^;-Y*hlv#w|XX3sT*L(#lMSKaa_X}(m=!Lk1 z*#$a1A^XWL7cRj2`+T7y+e!BFDA{3>=SBo#q`A_jXW1}d?FXAfc0`q~h%|6m!-w)i+B?@orZ23r^d)|g`6>2)_ zOZM>vVjPk7xd)tDpBrhQA>?fJc}28$798Bi-WX?PF%rv%AKT;~5-C4}9@*{Wyf88Y@uB zO%;lKB9)9AYKH3)jUfo_XzgfaI&KCOHcXLMU3oo~JylZq3Vl6P(@C@{-rZBbp&AYC z=++ZGJ>{!(y`wYL9&giI(aJbguL1Qd*HOE5jcEo$rH$sq^5tZum9S8vC$4XYQ9ATQ z+(@+WBGZ+yQ&)Ki#WW|=MyhiUDaRv;dL(!3ZpXdRXiG;Ljq>tDOFX3;sd%fAMmkJj zl&{zxPq!v?^amQ>9!WIm^^I5R4eJs-^Uf7r-9|mdo7=c~p|Miejh0mBZhd>a8TCjT zR@2k9<@HdTD7(?9Oe9k&rbn8nYAMl~P3vphIy;h0@$GF%UPjuo9!X6jgPf8b&25py zAJ&E@y(xrNtVGZ0J9~Qcu4F3R*%5DRHTLMcLROjFXcZy7QBSsa0Z%2n;Ch{@_|7ER zZ38^!%7n3}D+xRCF5KPPob2E}AiKJ%wKEMHq?45qct+j@I^4{zx+%%~s3Va?2Jp}HN{pn|ogJ2cSq_y- z^6s?Kk%e@HhQZbcn7CDYyQN%GKy>YNxpJs2gjwVWkggqRhd$z{cK z$I*u|N77o(kE>zH9xU-@vISyZC9Ur$>D?E#;t}I!W%=|Xb}2F=eF~X7m!T>%*cE*K zX6*TgZ^fgth+QN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@k0XlK+^``JHblc(nag_mvk4hv@Q0-wsBC0LhDWrsz;sa^K{ z>|ue6Y}tT_G}`cCf!}Jw<$m^kHhhtg|7VV4eiQvg-$p2Wh2vAKmlE-|Hf2*gOQejn z(Y<3w5c{e1+NO=0^k}59iT1kdbp_n@wfUrpebc(pt|w^cbehR+(h8*O&7Jzrw$AO? zOwQjn(PndoH%VP>Nh8@DTv=XT#VA2buoQybmN+usII5Gx9btz+Ubkk$k8fYZ|$_U&+A>OB*pZ2 zDiz-&_x|!7_5z}Pz%r+e*In0GkL}zwYohgJrb1;dsjBj`0}xXRuw)cK$khGChMM(} zT1Kzk^0naGloRQ0vEg5cq6Jgzc@KyACS_}5GWJgYk>?H+znJ#018upt7xUg5(+i}7 z*c2^V!VeCJecs`)vWJ?VS(vTk) zCZE*!bB<6<(Lma%Z>!LIo>2IcPEXhi*a#k@FP=jle+z?l_Yw zSKWo99XRxnxK*B@P);zQIr+mM1=-opLy%$BgBVi_C*szz4QmRcA%mE8_+!!-w)|n5 z^DKqg^YbCd>5o57W6Q^W8fj9crs!LKKt&$@n0z+JmIY2P*~%<9eS$P`UW7VJ996O@ O{N58|)>Df6<9`FW-Z&uu literal 0 HcmV?d00001 diff --git a/test/pos.cpp b/examples/pos.cpp similarity index 96% rename from test/pos.cpp rename to examples/pos.cpp index e4eefb01f..7896a3eb9 100644 --- a/test/pos.cpp +++ b/examples/pos.cpp @@ -1,7 +1,7 @@ #include #include -#include "postag_dll.h" +#include "ltp/postag_dll.h" int main(int argc, char * argv[]) { if (argc < 2) { diff --git a/examples/srl b/examples/srl new file mode 100755 index 0000000000000000000000000000000000000000..e80a434c1ef093b5cde26dbd3693deb089abf5e7 GIT binary patch literal 20917 zcmch93w&F}mG?-pZ0CWkyo!O82oP-o#MsUQ8)%VZn_PjNm^h)lf~?p|;?^%LIdOm% zvrYm+aWH({xJ@>ex;D|ydpph<&ov(@Bg1WBVAoP zEZbjyJBjbiIdjgLGiPSb%pKjC>uPGxce`9d2eo{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Xgu0nys)&iTreZt(%b{6tVCE_e9hf$Z5y;cHA||cI_EE| ztizdp1yLQH&Xgjz{$we<6rriJ6GyZg;;k{0h>@}{9w6BSVBRJC?X>JZTx5PSmNWG@Mr3KrF?Xh@gS4U^@{0b3XT)T8p zWos}QOg{^bk(5JRM9B%25TbXIGS|aHOj%vO%BhmUj~<6i<0;NlVW^zo7<) z$O~=1c!Kot-`)6*Bs45G!pi$-B6Jd4P0L=1bZpt{?g&4fuVN97{ zc#%RDbuo_LAN?K<>t+i3RRh7G?HKX_qGfMCm<5ORmQKqlV z;O!dKWxQ9xdH;Zttu7dlw=1Z74;-aRrL8*+#`0vY`bg_zUF*SnLDH8>WT^f=H;up! zW3R7psQpEEZ-ka&Ks4hjknUI%Ly4Kx&a)?=W)E&U;l+4NuYK22paKB2& z-{abmES+(4M)nZWx@6lEm*d#4ZsRB;t81lA@n3tyj2^ZtfyQVu)@@lHO<&wH_I4hJ2wWlLP&n)6804wDUT7zE V&rmjlwZh1Zql_)9O2?T2|36Qa`>g-~ literal 0 HcmV?d00001 diff --git a/test/srl.cpp b/examples/srl.cpp similarity index 98% rename from test/srl.cpp rename to examples/srl.cpp index f38003cfc..c38e98420 100644 --- a/test/srl.cpp +++ b/examples/srl.cpp @@ -1,7 +1,7 @@ #include #include -#include "SRL_DLL.h" +#include "ltp/SRL_DLL.h" int main(int argc, char * argv[]) { if (argc < 2) { diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 807301323..49d899cfc 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,6 @@ include_directories (./ ${SOURCE_DIR}/__util + ${SOURCE_DIR}/utils ${SOURCE_DIR}/__xml4nlp ${SOURCE_DIR}/_split_sentence ${SOURCE_DIR}/segmentor @@ -22,17 +23,13 @@ set (multi_ltp_test_SRC multi_ltp_test.cpp link_directories ( ${LIBRARY_OUTPUT_PATH} ) add_executable (ltp_test ${ltp_test_SRC}) -add_executable (cws cws.cpp) add_executable (cws_cmdline cws_cmdline.cpp) add_executable (multi_cws_cmdline multi_cws_cmdline.cpp ${THIRDPARTY_DIR}/tinythreadpp/tinythread.cpp) -add_executable (pos pos.cpp) -add_executable (pos_cmdline pos.cpp) +add_executable (pos_cmdline pos_cmdline.cpp) add_executable (multi_pos_cmdline multi_pos_cmdline.cpp ${THIRDPARTY_DIR}/tinythreadpp/tinythread.cpp) -add_executable (ner ner.cpp) -add_executable (par par.cpp) -add_executable (srl srl.cpp) +add_executable (par_cmdline par_cmdline.cpp) #add_executable (ltp_test_xml ${ltp_test_xml_SRC}) #add_executable (ltp_test2 ${ltp_test2_SRC}) @@ -53,16 +50,27 @@ if (NOT WIN32) set (ltp_test_LIBS ${ltp_test_LIBS} pthread) endif() +set (cws_cmdline_LIBS + segmentor_static_lib + boost_regex_static_lib) + +if (NOT WIN32) +set (cws_cmdline_LIBS ${cws_cmdline_LIBS} pthread) +endif() + +set (pos_cmdline_LIBS +postagger_static_lib) + +if (NOT WIN32) +set (pos_cmdline_LIBS ${pos_cmdline_LIBS} pthread) +endif() + target_link_libraries (ltp_test ${ltp_test_LIBS}) -target_link_libraries (cws segmentor_static_lib boost_regex_static_lib) -target_link_libraries (cws_cmdline segmentor_static_lib boost_regex_static_lib) -target_link_libraries (multi_cws_cmdline segmentor_static_lib boost_regex_static_lib pthread) -target_link_libraries (pos postagger_static_lib) -target_link_libraries (pos_cmdline postagger_static_lib) -target_link_libraries (multi_pos_cmdline postagger_static_lib pthread) -target_link_libraries (ner ner_static_lib) -target_link_libraries (par parser_static_lib) -target_link_libraries (srl srl_static_lib) +target_link_libraries (cws_cmdline ${cws_cmdline_LIBS}) +target_link_libraries (multi_cws_cmdline ${cws_cmdline_LIBS}) +target_link_libraries (pos_cmdline ${pos_cmdline_LIBS}) +target_link_libraries (multi_pos_cmdline ${pos_cmdline_LIBS}) +target_link_libraries (par_cmdline parser_static_lib) # # multithreaded ltp test is not supported in Windows # diff --git a/test/cws_cmdline.cpp b/test/cws_cmdline.cpp index 923a9bfc5..534231e34 100644 --- a/test/cws_cmdline.cpp +++ b/test/cws_cmdline.cpp @@ -14,16 +14,9 @@ #include #include #include -#include -#include +#include "time.hpp" #include "segment_dll.h" -double get_time(void) { - struct timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_sec + (tv.tv_usec / 1000000.0); -} - int main(int argc, char * argv[]) { if (argc < 2) { std::cerr << "cws [model path] [lexicon_file]" << std::endl; @@ -44,7 +37,7 @@ int main(int argc, char * argv[]) { std::string sentence; std::cerr << "TRACE: Model is loaded" << std::endl; - double tm = get_time(); + double tm = ltp::utility::get_time(); while (std::getline(std::cin, sentence, '\n')) { words.clear(); @@ -59,7 +52,7 @@ int main(int argc, char * argv[]) { segmentor_release_segmentor(engine); - tm = get_time() - tm; + tm = ltp::utility::get_time() - tm; std::cerr << "TRACE: cws-tm-consume " << tm << " seconds." diff --git a/test/multi_cws_cmdline.cpp b/test/multi_cws_cmdline.cpp index 3a6cea657..82980d5f5 100644 --- a/test/multi_cws_cmdline.cpp +++ b/test/multi_cws_cmdline.cpp @@ -15,10 +15,10 @@ #include #include #include +#include #include #include -#include -#include +#include "time.hpp" #include #include "tinythread.h" @@ -30,12 +30,6 @@ using namespace tthread; const int MAX_LEN = 1024; -double get_time(void) { - struct timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_sec + (tv.tv_usec / 1000000.0); -} - class Dispatcher { public: Dispatcher( void * model ) { @@ -124,7 +118,7 @@ int main(int argc, char ** argv) { Dispatcher* dispatcher = new Dispatcher( engine ); - double tm = get_time(); + double tm = ltp::utility::get_time(); list thread_list; for (int i = 0; i < num_threads; ++ i) { thread* t = new thread( multithreaded_segment, (void *)dispatcher ); @@ -138,7 +132,7 @@ int main(int argc, char ** argv) { delete t; } - tm = get_time() - tm; + tm = ltp::utility::get_time() - tm; std::cerr << "TRACE: consume " << tm << " seconds." diff --git a/test/multi_pos_cmdline.cpp b/test/multi_pos_cmdline.cpp index 9fed57483..9ef4cd6a9 100644 --- a/test/multi_pos_cmdline.cpp +++ b/test/multi_pos_cmdline.cpp @@ -17,8 +17,7 @@ #include #include #include -#include -#include +#include "time.hpp" #include "tinythread.h" #include "fast_mutex.h" @@ -29,12 +28,6 @@ using namespace tthread; const int MAX_LEN = 1024; -double get_time(void) { - struct timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_sec + (tv.tv_usec / 1000000.0); -} - class Dispatcher { public: Dispatcher( void * model ) { @@ -121,7 +114,7 @@ int main(int argc, char ** argv) { Dispatcher * dispatcher = new Dispatcher( engine ); - double tm = get_time(); + double tm = ltp::utility::get_time(); list thread_list; for (int i = 0; i < num_threads; ++ i) { thread * t = new thread( multithreaded_postag, (void *)dispatcher ); @@ -135,7 +128,7 @@ int main(int argc, char ** argv) { delete t; } - tm = get_time() - tm; + tm = ltp::utility::get_time() - tm; std::cerr << "TRACE: consume " << tm << " seconds." diff --git a/test/par_cmdline.cpp b/test/par_cmdline.cpp index 122efd133..b93e1e303 100644 --- a/test/par_cmdline.cpp +++ b/test/par_cmdline.cpp @@ -4,15 +4,8 @@ #include #include #include -#include -#include -#include "ltp/parser_dll.h" - -double get_time(void) { - struct timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_sec + (tv.tv_usec / 1000000.0); -} +#include "time.hpp" +#include "parser_dll.h" int main(int argc, char * argv[]) { if (argc < 2) { @@ -32,7 +25,7 @@ int main(int argc, char * argv[]) { std::vector deprels; std::cerr << "TRACE: Model is loaded" << std::endl; - double tm = get_time(); + double tm = ltp::utility::get_time(); while (std::getline(std::cin, line, '\n')) { if (line.size() == 0) { continue; } @@ -58,7 +51,7 @@ int main(int argc, char * argv[]) { parser_release_parser(engine); - tm = get_time() - tm; + tm = ltp::utility::get_time() - tm; std::cerr << "TRACE: par-tm-consume " << tm << " seconds." diff --git a/test/pos_cmdline.cpp b/test/pos_cmdline.cpp index f7d0af00b..b821d5155 100644 --- a/test/pos_cmdline.cpp +++ b/test/pos_cmdline.cpp @@ -16,16 +16,9 @@ #include #include #include -#include -#include +#include "time.hpp" #include "postag_dll.h" -double get_time(void) { - struct timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_sec + (tv.tv_usec / 1000000.0); -} - int main(int argc, char * argv[]) { if (argc < 2 || (0 == strcmp(argv[1], "-h"))) { std::cerr << "Example: ./pos_cmdline [model path]" << std::endl; @@ -48,7 +41,7 @@ int main(int argc, char * argv[]) { std::vector postags; std::cerr << "TRACE: Model is loaded" << std::endl; - double tm = get_time(); + double tm = ltp::utility::get_time(); while (std::getline(std::cin, line, '\n')) { std::stringstream S(line); @@ -71,7 +64,7 @@ int main(int argc, char * argv[]) { postagger_release_postagger(engine); - tm = get_time() - tm; + tm = ltp::utility::get_time() - tm; std::cerr << "TRACE: pos-tm-consume " << tm << " seconds."