├── AUTHORS ├── _config.yml ├── thirdparty ├── jsoncpp │ ├── version │ ├── version.in │ ├── src │ │ ├── CMakeLists.txt │ │ └── lib_json │ │ │ └── sconscript │ ├── include │ │ ├── CMakeLists.txt │ │ └── json │ │ │ ├── json.h │ │ │ ├── autolink.h │ │ │ └── version.h │ └── pkg-config │ │ └── jsoncpp.pc.in ├── boost │ ├── CMakeLists.txt │ ├── include │ │ └── boost │ │ │ ├── format │ │ │ └── alt_sstream_impl.hpp │ │ │ ├── smart_ptr │ │ │ └── detail │ │ │ │ └── atomic_count_gcc.hpp │ │ │ ├── functional │ │ │ ├── hash.hpp │ │ │ └── hash_fwd.hpp │ │ │ ├── concept │ │ │ └── detail │ │ │ │ ├── concept_undef.hpp │ │ │ │ └── backward_compatibility.hpp │ │ │ ├── pending │ │ │ └── integer_log2.hpp │ │ │ ├── config │ │ │ ├── abi │ │ │ │ ├── msvc_suffix.hpp │ │ │ │ └── borland_suffix.hpp │ │ │ ├── platform │ │ │ │ ├── amigaos.hpp │ │ │ │ ├── cray.hpp │ │ │ │ ├── cloudabi.hpp │ │ │ │ └── beos.hpp │ │ │ ├── compiler │ │ │ │ └── compaq_cxx.hpp │ │ │ └── abi_prefix.hpp │ │ │ ├── predef │ │ │ ├── detail │ │ │ │ ├── os_detected.h │ │ │ │ ├── comp_detected.h │ │ │ │ ├── platform_detected.h │ │ │ │ ├── _exception.h │ │ │ │ ├── _cassert.h │ │ │ │ ├── test.h │ │ │ │ └── endian_compat.h │ │ │ ├── library │ │ │ │ ├── c │ │ │ │ │ └── _prefix.h │ │ │ │ └── c.h │ │ │ ├── version.h │ │ │ ├── other.h │ │ │ ├── hardware.h │ │ │ ├── library.h │ │ │ ├── language.h │ │ │ └── platform.h │ │ │ ├── mpl │ │ │ ├── aux_ │ │ │ │ ├── preprocessed │ │ │ │ │ ├── bcc551 │ │ │ │ │ │ └── quote.hpp │ │ │ │ │ ├── msvc60 │ │ │ │ │ │ └── quote.hpp │ │ │ │ │ ├── no_ttp │ │ │ │ │ │ └── quote.hpp │ │ │ │ │ ├── bcc_pre590 │ │ │ │ │ │ └── quote.hpp │ │ │ │ │ ├── dmc │ │ │ │ │ │ └── template_arity.hpp │ │ │ │ │ ├── mwcw │ │ │ │ │ │ └── template_arity.hpp │ │ │ │ │ └── plain │ │ │ │ │ │ └── template_arity.hpp │ │ │ │ ├── config │ │ │ │ │ ├── workaround.hpp │ │ │ │ │ ├── msvc.hpp │ │ │ │ │ ├── intel.hpp │ │ │ │ │ ├── use_preprocessed.hpp │ │ │ │ │ ├── gcc.hpp │ │ │ │ │ └── static_constant.hpp │ │ │ │ ├── has_size.hpp │ │ │ │ ├── has_tag.hpp │ │ │ │ ├── has_type.hpp │ │ │ │ ├── template_arity_fwd.hpp │ │ │ │ └── has_begin.hpp │ │ │ ├── next.hpp │ │ │ ├── prior.hpp │ │ │ ├── logical.hpp │ │ │ ├── less.hpp │ │ │ ├── plus.hpp │ │ │ ├── minus.hpp │ │ │ ├── times.hpp │ │ │ ├── int.hpp │ │ │ ├── limits │ │ │ │ ├── list.hpp │ │ │ │ ├── vector.hpp │ │ │ │ ├── arity.hpp │ │ │ │ └── unrolling.hpp │ │ │ ├── greater.hpp │ │ │ ├── equal_to.hpp │ │ │ ├── long.hpp │ │ │ ├── less_equal.hpp │ │ │ ├── list │ │ │ │ ├── aux_ │ │ │ │ │ └── tag.hpp │ │ │ │ └── list0_c.hpp │ │ │ ├── not_equal_to.hpp │ │ │ ├── greater_equal.hpp │ │ │ ├── at_fwd.hpp │ │ │ ├── back_fwd.hpp │ │ │ ├── size_fwd.hpp │ │ │ ├── clear_fwd.hpp │ │ │ ├── empty_fwd.hpp │ │ │ ├── front_fwd.hpp │ │ │ ├── O1_size_fwd.hpp │ │ │ ├── pop_back_fwd.hpp │ │ │ ├── pop_front_fwd.hpp │ │ │ ├── push_back_fwd.hpp │ │ │ ├── push_front_fwd.hpp │ │ │ ├── sequence_tag_fwd.hpp │ │ │ ├── void_fwd.hpp │ │ │ ├── contains_fwd.hpp │ │ │ ├── size_t.hpp │ │ │ ├── comparison.hpp │ │ │ ├── begin_end_fwd.hpp │ │ │ ├── advance_fwd.hpp │ │ │ ├── distance_fwd.hpp │ │ │ ├── inserter.hpp │ │ │ ├── int_fwd.hpp │ │ │ └── long_fwd.hpp │ │ │ ├── detail │ │ │ ├── endian.hpp │ │ │ ├── scoped_enum_emulation.hpp │ │ │ ├── no_exceptions_support.hpp │ │ │ ├── iterator.hpp │ │ │ ├── atomic_count.hpp │ │ │ ├── quick_allocator.hpp │ │ │ └── lightweight_mutex.hpp │ │ │ ├── ref.hpp │ │ │ ├── swap.hpp │ │ │ ├── utility │ │ │ ├── declval.hpp │ │ │ ├── swap.hpp │ │ │ ├── addressof.hpp │ │ │ └── enable_if.hpp │ │ │ ├── align │ │ │ ├── detail │ │ │ │ ├── align_cxx11.hpp │ │ │ │ └── is_alignment.hpp │ │ │ └── align.hpp │ │ │ ├── noncopyable.hpp │ │ │ ├── function │ │ │ ├── function0.hpp │ │ │ ├── function1.hpp │ │ │ ├── function10.hpp │ │ │ ├── function2.hpp │ │ │ ├── function3.hpp │ │ │ ├── function4.hpp │ │ │ ├── function5.hpp │ │ │ ├── function6.hpp │ │ │ ├── function7.hpp │ │ │ ├── function8.hpp │ │ │ ├── function9.hpp │ │ │ └── detail │ │ │ │ └── function_iterate.hpp │ │ │ ├── checked_delete.hpp │ │ │ ├── chrono │ │ │ ├── chrono.hpp │ │ │ └── clock_string.hpp │ │ │ ├── move │ │ │ └── detail │ │ │ │ ├── config_end.hpp │ │ │ │ └── std_ns_end.hpp │ │ │ ├── iterator.hpp │ │ │ ├── container │ │ │ └── detail │ │ │ │ └── config_end.hpp │ │ │ ├── weak_ptr.hpp │ │ │ ├── type.hpp │ │ │ ├── scoped_ptr.hpp │ │ │ ├── preprocessor.hpp │ │ │ ├── scoped_array.hpp │ │ │ ├── intrusive │ │ │ └── detail │ │ │ │ └── config_end.hpp │ │ │ ├── type_traits │ │ │ ├── type_identity.hpp │ │ │ ├── promote.hpp │ │ │ ├── conversion_traits.hpp │ │ │ ├── add_lvalue_reference.hpp │ │ │ ├── conditional.hpp │ │ │ ├── remove_bounds.hpp │ │ │ └── has_unary_plus.hpp │ │ │ ├── optional.hpp │ │ │ ├── interprocess │ │ │ └── detail │ │ │ │ ├── config_external_end.hpp │ │ │ │ ├── config_end.hpp │ │ │ │ └── config_external_begin.hpp │ │ │ ├── range │ │ │ ├── iterator_range.hpp │ │ │ └── functions.hpp │ │ │ ├── archive │ │ │ └── detail │ │ │ │ ├── abi_suffix.hpp │ │ │ │ └── abi_prefix.hpp │ │ │ ├── enable_shared_from_this.hpp │ │ │ ├── shared_ptr.hpp │ │ │ ├── random │ │ │ └── detail │ │ │ │ ├── config.hpp │ │ │ │ └── enable_warnings.hpp │ │ │ ├── preprocessor │ │ │ ├── punctuation │ │ │ │ └── comma.hpp │ │ │ ├── facilities │ │ │ │ └── empty.hpp │ │ │ ├── dec.hpp │ │ │ ├── inc.hpp │ │ │ ├── slot.hpp │ │ │ └── enum.hpp │ │ │ ├── spirit │ │ │ ├── include │ │ │ │ ├── classic_chset.hpp │ │ │ │ ├── classic_rule.hpp │ │ │ │ ├── classic_numerics.hpp │ │ │ │ ├── classic_operators.hpp │ │ │ │ └── classic_actions.hpp │ │ │ └── home │ │ │ │ └── classic │ │ │ │ └── core │ │ │ │ └── nil.hpp │ │ │ ├── unordered │ │ │ └── detail │ │ │ │ └── fwd.hpp │ │ │ ├── unordered_map.hpp │ │ │ ├── unordered_set.hpp │ │ │ ├── ratio │ │ │ └── mpl │ │ │ │ └── rational_c_tag.hpp │ │ │ ├── mem_fn.hpp │ │ │ ├── program_options │ │ │ └── version.hpp │ │ │ ├── blank_fwd.hpp │ │ │ ├── call_traits.hpp │ │ │ ├── aligned_storage.hpp │ │ │ ├── non_type.hpp │ │ │ ├── predef.h │ │ │ ├── compressed_pair.hpp │ │ │ ├── date_time │ │ │ └── special_defs.hpp │ │ │ ├── is_placeholder.hpp │ │ │ ├── iterator │ │ │ └── detail │ │ │ │ └── config_undef.hpp │ │ │ ├── visit_each.hpp │ │ │ └── filesystem.hpp │ └── libs │ │ ├── CMakeLists.txt │ │ ├── regex │ │ └── CMakeLists.txt │ │ ├── smart_ptr │ │ └── CMakeLists.txt │ │ ├── program_options │ │ ├── CMakeLists.txt │ │ └── src │ │ │ └── utf8_codecvt_facet.cpp │ │ └── serialization │ │ └── CMakeLists.txt ├── dynet │ ├── dynet │ │ ├── gpu-nodes-conv2d.cu │ │ ├── gpu-model.cu │ │ ├── gpu-nodes.cu │ │ ├── gpu-tensor.cu │ │ ├── gpu-training.cu │ │ ├── gpu-nodes-conv.cu │ │ ├── gpu-nodes-contract.cu │ │ ├── gpu-param-nodes.cu │ │ ├── graph.h │ │ ├── weight-decay.cc │ │ ├── saxe-init.h │ │ ├── globals.cc │ │ ├── globals.h │ │ ├── grad-check.h │ │ ├── dynet-helper.h │ │ ├── pretrain.h │ │ ├── rnn-state-machine.cc │ │ ├── timing.h │ │ ├── gpu-ops.h │ │ ├── saxe-init.cc │ │ └── dim.cc │ ├── config.h.cmake │ ├── cmake │ │ └── FindDyNet.cmake │ └── MEM.notes ├── eigen │ ├── Eigen │ │ ├── Eigen │ │ ├── src │ │ │ ├── Core │ │ │ │ ├── util │ │ │ │ │ └── NonMPL2.h │ │ │ │ └── functors │ │ │ │ │ └── TernaryFunctors.h │ │ │ └── misc │ │ │ │ └── lapacke_mangling.h │ │ ├── Dense │ │ ├── CMakeLists.txt │ │ └── StdList │ ├── unsupported │ │ ├── test │ │ │ └── FFT.cpp │ │ ├── doc │ │ │ ├── CMakeLists.txt │ │ │ └── examples │ │ │ │ ├── MatrixExponential.cpp │ │ │ │ ├── MatrixPower.cpp │ │ │ │ ├── MatrixLogarithm.cpp │ │ │ │ ├── MatrixPower_optimal.cpp │ │ │ │ ├── MatrixSquareRoot.cpp │ │ │ │ ├── MatrixFunction.cpp │ │ │ │ ├── MatrixSine.cpp │ │ │ │ ├── MatrixSinh.cpp │ │ │ │ ├── PolynomialUtils1.cpp │ │ │ │ └── CMakeLists.txt │ │ ├── Eigen │ │ │ ├── src │ │ │ │ └── EulerAngles │ │ │ │ │ └── CMakeLists.txt │ │ │ ├── CXX11 │ │ │ │ └── CMakeLists.txt │ │ │ ├── MoreVectorization │ │ │ └── CMakeLists.txt │ │ └── CMakeLists.txt │ ├── .hgeol │ └── .hgignore ├── tinyxml │ ├── tinystr.cpp │ └── CMakeLists.txt ├── gtest │ └── CMakeLists.txt └── CMakeLists.txt ├── tools └── train │ ├── sample │ ├── seg │ │ ├── example-train.seg │ │ └── example-holdout.seg │ ├── pos │ │ ├── example-holdout.pos │ │ └── example-train.pos │ ├── ner │ │ ├── example-train.ner │ │ └── example-holdout.ner │ ├── srl │ │ ├── example-test.pisrl │ │ ├── example-pi.config │ │ ├── example-srl.config │ │ ├── example-train.srl │ │ └── example-heldout.srl │ └── parser │ │ ├── example-holdout.conll │ │ └── example-train.conll │ └── README.md ├── INSTALL ├── src ├── srl │ ├── Pi │ │ ├── process │ │ │ ├── PredSrlPi.cpp │ │ │ └── TrainSrlPi.cpp │ │ ├── pred.cpp │ │ ├── train.cpp │ │ └── CMakeLists.txt │ ├── Srl │ │ ├── process │ │ │ ├── PredSrlSrl.cpp │ │ │ └── TrainSrlSrl.cpp │ │ ├── pred.cpp │ │ ├── train.cpp │ │ └── CMakeLists.txt │ ├── include │ │ ├── extractor │ │ │ ├── ExtractorFileToSample.cpp │ │ │ ├── AbstractExtractor.h │ │ │ ├── AbstractConverter.h │ │ │ ├── Extractor.h │ │ │ └── ConverterBlockToConcept.h │ │ ├── structure │ │ │ ├── Prediction.h │ │ │ ├── DataConcept.h │ │ │ ├── Data.h │ │ │ ├── DataFileName.h │ │ │ └── DataFileContext.h │ │ ├── CMakeLists.txt │ │ ├── model │ │ │ ├── Model.h │ │ │ └── LoopCounter.h │ │ ├── base │ │ │ ├── process.h │ │ │ └── debug.cpp │ │ └── process │ │ │ ├── ModelTester.h │ │ │ ├── ModelTrainer.h │ │ │ ├── AbstractTrainer.h │ │ │ ├── ModelPredictor.h │ │ │ └── AbstractPredictor.h │ ├── common │ │ ├── structure │ │ │ └── SrlPiSample.cpp │ │ ├── Const.h │ │ ├── CMakeLists.txt │ │ └── model │ │ │ ├── AffineTransformModelBuilder.cpp │ │ │ └── ConstLookupModelBuilder.h │ └── tool │ │ ├── CMakeLists.txt │ │ └── merge.cpp ├── ltp │ └── CMakeLists.txt ├── xml4nlp │ └── CMakeLists.txt ├── ner │ ├── options.cpp │ ├── options.h │ ├── settings.h │ └── extractor.h ├── server │ ├── run.pl │ └── CMakeLists.txt ├── parser.n │ ├── options.cpp │ └── context.h ├── parser │ ├── options.cpp │ └── parameters.h ├── config.h ├── segmentor │ ├── special_tokens.h │ ├── options.h │ ├── partial_segmentation.h │ └── model.cpp ├── splitsnt │ ├── SplitSentence.cpp │ └── CMakeLists.txt ├── postagger │ ├── options.h │ ├── settings.h │ └── extractor.h ├── unittest │ ├── unittest.cpp │ └── utils_smartmap_unittest.cpp ├── utils │ └── math │ │ ├── featurevec.h │ │ └── fast_binned.h.py └── framework │ └── serializable.h ├── configure ├── doc ├── otherlanguage.rst ├── begin.rst ├── intro.rst ├── license.rst └── index.rst ├── conf └── ltp.cnf ├── COPYING └── Dockerfile /AUTHORS: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /thirdparty/jsoncpp/version: -------------------------------------------------------------------------------- 1 | 1.7.7 2 | -------------------------------------------------------------------------------- /thirdparty/jsoncpp/version.in: -------------------------------------------------------------------------------- 1 | @JSONCPP_VERSION@ 2 | -------------------------------------------------------------------------------- /thirdparty/boost/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ADD_SUBDIRECTORY(libs) 2 | -------------------------------------------------------------------------------- /thirdparty/jsoncpp/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ADD_SUBDIRECTORY(lib_json) 2 | -------------------------------------------------------------------------------- /thirdparty/dynet/dynet/gpu-nodes-conv2d.cu: -------------------------------------------------------------------------------- 1 | #include "nodes-conv2d.cc" 2 | -------------------------------------------------------------------------------- /thirdparty/eigen/Eigen/Eigen: -------------------------------------------------------------------------------- 1 | #include "Dense" 2 | #include "Sparse" 3 | -------------------------------------------------------------------------------- /tools/train/sample/seg/example-train.seg: -------------------------------------------------------------------------------- 1 | 中国 进出口 银行 与 中国 银行 加强 合作 2 | 3 | -------------------------------------------------------------------------------- /tools/train/sample/seg/example-holdout.seg: -------------------------------------------------------------------------------- 1 | 中国 进出口 银行 与 中国 银行 加强 合作 2 | 3 | -------------------------------------------------------------------------------- /tools/train/sample/pos/example-holdout.pos: -------------------------------------------------------------------------------- 1 | 中国_ns 进出口_n 银行_n 与_p 中国_ns 银行_n 加强_v 合作_v 2 | 3 | -------------------------------------------------------------------------------- /tools/train/sample/pos/example-train.pos: -------------------------------------------------------------------------------- 1 | 中国_ns 进出口_n 银行_n 与_p 中国_ns 银行_n 加强_v 合作_v 2 | 3 | -------------------------------------------------------------------------------- /thirdparty/eigen/unsupported/test/FFT.cpp: -------------------------------------------------------------------------------- 1 | #define test_FFTW test_FFT 2 | #include "FFTW.cpp" 3 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Installation Instructions 2 | ************************* 3 | 4 | Please refer to doc/install.rst 5 | -------------------------------------------------------------------------------- /thirdparty/tinyxml/tinystr.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binhetech/ltp/master/thirdparty/tinyxml/tinystr.cpp -------------------------------------------------------------------------------- /src/srl/Pi/process/PredSrlPi.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017-05-12. 3 | // 4 | 5 | #include "PredSrlPi.h" 6 | -------------------------------------------------------------------------------- /src/srl/Pi/process/TrainSrlPi.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017-05-12. 3 | // 4 | 5 | #include "TrainSrlPi.h" 6 | -------------------------------------------------------------------------------- /src/srl/Srl/process/PredSrlSrl.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017-05-12. 3 | // 4 | 5 | #include "PredSrlSrl.h" 6 | -------------------------------------------------------------------------------- /src/srl/Srl/process/TrainSrlSrl.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017-05-12. 3 | // 4 | 5 | #include "TrainSrlSrl.h" 6 | -------------------------------------------------------------------------------- /tools/train/sample/ner/example-train.ner: -------------------------------------------------------------------------------- 1 | 中国/ns#B-Ni 进出口/n#I-Ni 银行/n#E-Ni 与/p#O 中国/ns#B-Ni 银行/n#E-Ni 加强/v#O 合作/v#O 2 | 3 | -------------------------------------------------------------------------------- /tools/train/sample/ner/example-holdout.ner: -------------------------------------------------------------------------------- 1 | 中国/ns#B-Ni 进出口/n#I-Ni 银行/n#E-Ni 与/p#O 中国/ns#B-Ni 银行/n#E-Ni 加强/v#O 合作/v#O 2 | 3 | -------------------------------------------------------------------------------- /thirdparty/eigen/Eigen/src/Core/util/NonMPL2.h: -------------------------------------------------------------------------------- 1 | #ifdef EIGEN_MPL2_ONLY 2 | #error Including non-MPL2 code in EIGEN_MPL2_ONLY mode 3 | #endif 4 | -------------------------------------------------------------------------------- /src/srl/include/extractor/ExtractorFileToSample.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/1/2. 3 | // 4 | 5 | #include "ExtractorFileToSample.h" 6 | -------------------------------------------------------------------------------- /thirdparty/dynet/dynet/gpu-model.cu: -------------------------------------------------------------------------------- 1 | // This is a dummy file that contains the same content as model.cc but compiled 2 | // on CUDA 3 | #include "model.cc" 4 | -------------------------------------------------------------------------------- /thirdparty/dynet/dynet/gpu-nodes.cu: -------------------------------------------------------------------------------- 1 | // This is a dummy file that contains the same content as nodes.cc but compiled 2 | // on CUDA 3 | #include "nodes.cc" 4 | -------------------------------------------------------------------------------- /thirdparty/jsoncpp/include/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB INCLUDE_FILES "json/*.h") 2 | INSTALL(FILES ${INCLUDE_FILES} DESTINATION ${INCLUDE_INSTALL_DIR}/json) 3 | -------------------------------------------------------------------------------- /thirdparty/dynet/dynet/gpu-tensor.cu: -------------------------------------------------------------------------------- 1 | // This is a dummy file that contains the same content as tensor.cc but compiled 2 | // on CUDA 3 | #include "tensor.cc" 4 | -------------------------------------------------------------------------------- /thirdparty/gtest/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories (./ ./src/ ./include) 2 | set (libgtest_SOURCE src/gtest-all.cc) 3 | add_library (gtest ${libgtest_SOURCE}) 4 | -------------------------------------------------------------------------------- /configure: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | if [ ! -d build ]; then 3 | mkdir -p build 4 | fi 5 | 6 | (cd build >/dev/null 2>&1 && cmake -DCMAKE_BUILD_TYPE=Release .. "$@") 7 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/format/alt_sstream_impl.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binhetech/ltp/master/thirdparty/boost/include/boost/format/alt_sstream_impl.hpp -------------------------------------------------------------------------------- /thirdparty/dynet/dynet/gpu-training.cu: -------------------------------------------------------------------------------- 1 | // This is a dummy file that contains the same content as training.cc but compiled 2 | // on CUDA 3 | #include "training.cc" 4 | -------------------------------------------------------------------------------- /thirdparty/dynet/dynet/gpu-nodes-conv.cu: -------------------------------------------------------------------------------- 1 | // This is a dummy file that contains the same content as nodes-conv.cc but compiled 2 | // on CUDA 3 | #include "nodes-conv.cc" 4 | -------------------------------------------------------------------------------- /thirdparty/boost/libs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory (program_options) 2 | add_subdirectory (regex) 3 | add_subdirectory (serialization) 4 | add_subdirectory (smart_ptr) 5 | -------------------------------------------------------------------------------- /thirdparty/dynet/dynet/gpu-nodes-contract.cu: -------------------------------------------------------------------------------- 1 | // This is a dummy file that contains the same content as nodes.cc but compiled 2 | // on CUDA 3 | #include "nodes-contract.cc" 4 | -------------------------------------------------------------------------------- /thirdparty/dynet/dynet/gpu-param-nodes.cu: -------------------------------------------------------------------------------- 1 | // This is a dummy file that contains the same content as param-nodes.cc but compiled 2 | // on CUDA 3 | #include "param-nodes.cc" 4 | -------------------------------------------------------------------------------- /thirdparty/eigen/Eigen/Dense: -------------------------------------------------------------------------------- 1 | #include "Core" 2 | #include "LU" 3 | #include "Cholesky" 4 | #include "QR" 5 | #include "SVD" 6 | #include "Geometry" 7 | #include "Eigenvalues" 8 | -------------------------------------------------------------------------------- /thirdparty/eigen/unsupported/doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL TRUE) 2 | 3 | add_subdirectory(examples) 4 | add_subdirectory(snippets) 5 | -------------------------------------------------------------------------------- /tools/train/README.md: -------------------------------------------------------------------------------- 1 | # Training Suite for LTP 2 | 3 | for running all the training process, just execute 4 | 5 | ``` 6 | ./rock.sh 7 | ``` 8 | 9 | after compilation 10 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/smart_ptr/detail/atomic_count_gcc.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/binhetech/ltp/master/thirdparty/boost/include/boost/smart_ptr/detail/atomic_count_gcc.hpp -------------------------------------------------------------------------------- /tools/train/sample/srl/example-test.pisrl: -------------------------------------------------------------------------------- 1 | 中国 ns 2 ATT 2 | 进出口 n 2 ATT 3 | 银行 n 6 SBV 4 | 与 p 2 ADV 5 | 中国 ns 5 ATT 6 | 银行 n 3 POB 7 | 加强 v -1 HED 8 | 合作 v 6 VOB 9 | -------------------------------------------------------------------------------- /src/ltp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories (./ 2 | ${SOURCE_DIR}/ 3 | ${THIRDPARTY_DIR}/tinyxml) 4 | 5 | SET(ltp_SRC Ltp.cpp LTPResource.cpp) 6 | 7 | ADD_LIBRARY(ltp ${ltp_SRC}) 8 | -------------------------------------------------------------------------------- /tools/train/sample/srl/example-pi.config: -------------------------------------------------------------------------------- 1 | model=pi.model 2 | activate=tanh 3 | word_dim=100 4 | emb_dim=200 5 | pos_dim=20 6 | rel_dim=50 7 | lstm_input_dim=100 8 | lstm_hidden_dim=200 9 | layers=1 10 | -------------------------------------------------------------------------------- /thirdparty/jsoncpp/src/lib_json/sconscript: -------------------------------------------------------------------------------- 1 | Import( 'env buildLibrary' ) 2 | 3 | buildLibrary( env, Split( """ 4 | json_reader.cpp 5 | json_value.cpp 6 | json_writer.cpp 7 | """ ), 8 | 'json' ) 9 | -------------------------------------------------------------------------------- /thirdparty/dynet/dynet/graph.h: -------------------------------------------------------------------------------- 1 | #ifndef DYNET_GRAPH_H 2 | #define DYNET_GRAPH_H 3 | 4 | namespace dynet { 5 | struct ComputationGraph; 6 | void graph_optimize(ComputationGraph* cg); 7 | } // namespace dynet 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /thirdparty/tinyxml/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set (tinyxml_SRC 2 | tinystr.h 3 | tinyxml.h 4 | tinystr.cpp 5 | tinyxml.cpp 6 | tinyxmlerror.cpp 7 | tinyxmlparser.cpp) 8 | 9 | add_library (tinyxml ${tinyxml_SRC}) 10 | -------------------------------------------------------------------------------- /thirdparty/dynet/dynet/weight-decay.cc: -------------------------------------------------------------------------------- 1 | #include "dynet/weight-decay.h" 2 | 3 | namespace dynet { 4 | 5 | DYNET_SERIALIZE_COMMIT(L2WeightDecay, DYNET_SERIALIZE_DEFINE(weight_decay, lambda)) 6 | DYNET_SERIALIZE_IMPL(L2WeightDecay) 7 | 8 | } 9 | -------------------------------------------------------------------------------- /thirdparty/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory (boost) 2 | add_subdirectory (maxent) 3 | add_subdirectory (tinyxml) 4 | add_subdirectory (jsoncpp) 5 | add_subdirectory (dynet) 6 | 7 | if (UNIX) 8 | add_subdirectory (gtest) 9 | endif() 10 | 11 | 12 | -------------------------------------------------------------------------------- /thirdparty/dynet/dynet/saxe-init.h: -------------------------------------------------------------------------------- 1 | #ifndef DYNET_SAXE_INIT_H_ 2 | #define DYNET_SAXE_INIT_H_ 3 | 4 | namespace dynet { 5 | 6 | struct Tensor; 7 | 8 | void orthonormal_random(unsigned dim, float g, Tensor& x); 9 | 10 | } 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /tools/train/sample/srl/example-srl.config: -------------------------------------------------------------------------------- 1 | model=srl.model 2 | activate=rectify 3 | word_dim=100 4 | emb_dim=200 5 | pos_dim=20 6 | rel_dim=50 7 | position_dim=5 8 | lstm_input_dim=100 9 | lstm_hidden_dim=200 10 | hidden_dim=200 11 | layers=1 12 | -------------------------------------------------------------------------------- /src/srl/common/structure/SrlPiSample.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/5/18. 3 | // 4 | 5 | #include "SrlPiSample.h" 6 | #include "Const.h" 7 | 8 | Word SrlPiSample::root = Word(0, ROOT_MARK, ROOT_MARK, -1, ROOT_MARK, "before", NIL_LABEL); 9 | 10 | -------------------------------------------------------------------------------- /thirdparty/eigen/.hgeol: -------------------------------------------------------------------------------- 1 | [patterns] 2 | *.sh = LF 3 | *.MINPACK = CRLF 4 | scripts/*.in = LF 5 | debug/msvc/*.dat = CRLF 6 | debug/msvc/*.natvis = CRLF 7 | unsupported/test/mpreal/*.* = CRLF 8 | ** = native 9 | 10 | [repository] 11 | native = LF 12 | -------------------------------------------------------------------------------- /thirdparty/eigen/unsupported/Eigen/src/EulerAngles/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB Eigen_EulerAngles_SRCS "*.h") 2 | 3 | INSTALL(FILES 4 | ${Eigen_EulerAngles_SRCS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/src/EulerAngles COMPONENT Devel 6 | ) 7 | -------------------------------------------------------------------------------- /src/xml4nlp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRECTORIES(${SOURCE_DIR} 2 | ${THIRDPARTY_DIR}/tinyxml) 3 | 4 | SET(xml4nlp_source 5 | Xml4nlp.h 6 | Xml4nlp.cpp) 7 | 8 | ADD_LIBRARY(xml4nlp ${xml4nlp_source}) 9 | 10 | TARGET_LINK_LIBRARIES(xml4nlp tinyxml) 11 | -------------------------------------------------------------------------------- /thirdparty/dynet/config.h.cmake: -------------------------------------------------------------------------------- 1 | #ifndef DYNET_CONFIG_H_ 2 | #define DYNET_CONFIG_H_ 3 | 4 | #cmakedefine WITH_MINERVA_BACKEND @WITH_MINERVA_BACKEND@ 5 | #cmakedefine WITH_THPP_BACKEND @WITH_THPP_BACKEND@ 6 | #cmakedefine WITH_EIGEN_BACKEND @WITH_EIGEN_BACKEND@ 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /tools/train/sample/parser/example-holdout.conll: -------------------------------------------------------------------------------- 1 | 1 中国 _ ns ns _ 3 ATT _ _ 2 | 2 进出口 _ n n _ 3 ATT _ _ 3 | 3 银行 _ n n _ 7 SBV _ _ 4 | 4 与 _ p p _ 3 ADV _ _ 5 | 5 中国 _ ns ns _ 6 ATT _ _ 6 | 6 银行 _ n n _ 4 POB _ _ 7 | 7 加强 _ v v _ 0 HED _ _ 8 | 8 合作 _ v v _ 7 VOB _ _ 9 | 10 | -------------------------------------------------------------------------------- /tools/train/sample/parser/example-train.conll: -------------------------------------------------------------------------------- 1 | 1 中国 _ ns ns _ 3 ATT _ _ 2 | 2 进出口 _ n n _ 3 ATT _ _ 3 | 3 银行 _ n n _ 7 SBV _ _ 4 | 4 与 _ p p _ 3 ADV _ _ 5 | 5 中国 _ ns ns _ 6 ATT _ _ 6 | 6 银行 _ n n _ 4 POB _ _ 7 | 7 加强 _ v v _ 0 HED _ _ 8 | 8 合作 _ v v _ 7 VOB _ _ 9 | 10 | -------------------------------------------------------------------------------- /thirdparty/dynet/dynet/globals.cc: -------------------------------------------------------------------------------- 1 | #include "dynet/globals.h" 2 | #include "dynet/devices.h" 3 | 4 | namespace dynet { 5 | 6 | std::mt19937* rndeng = nullptr; 7 | std::vector devices; 8 | Device* default_device = nullptr; 9 | float weight_decay_lambda; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /thirdparty/eigen/unsupported/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Eigen) 2 | add_subdirectory(doc EXCLUDE_FROM_ALL) 3 | if(EIGEN_LEAVE_TEST_IN_ALL_TARGET) 4 | add_subdirectory(test) # can't do EXCLUDE_FROM_ALL here, breaks CTest 5 | else() 6 | add_subdirectory(test EXCLUDE_FROM_ALL) 7 | endif() 8 | -------------------------------------------------------------------------------- /src/ner/options.cpp: -------------------------------------------------------------------------------- 1 | #include "ner/options.h" 2 | 3 | namespace ltp { 4 | namespace ner { 5 | 6 | ModelOptions model_opt; 7 | TrainOptions train_opt; 8 | TestOptions test_opt; 9 | DumpOptions dump_opt; 10 | 11 | } // end for namespace ner 12 | } // end for namespace ltp 13 | -------------------------------------------------------------------------------- /src/server/run.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | $app = ltp_server; 3 | while(1){ 4 | $result = `ps aux | grep $app | grep -v grep`; 5 | unless($result){ 6 | system("nohup ./$app &") == 0 7 | or die "can not start $app: $!"; 8 | } 9 | sleep 10; 10 | } 11 | -------------------------------------------------------------------------------- /src/srl/tool/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(srl_merge_tool merge.cpp process/merge.h) 2 | target_link_libraries(srl_merge_tool dynet srl_srl_static_lib ${LIBS}) 3 | set_target_properties (srl_merge_tool PROPERTIES 4 | OUTPUT_NAME srl_merge_tool 5 | RUNTIME_OUTPUT_DIRECTORY ${TOOLS_DIR}/train/) 6 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/functional/hash.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright 2005-2009 Daniel James. 3 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 4 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | #include 7 | 8 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/concept/detail/concept_undef.hpp: -------------------------------------------------------------------------------- 1 | // Copyright David Abrahams 2006. Distributed under the Boost 2 | // Software License, Version 1.0. (See accompanying 3 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4 | # undef BOOST_concept_typename 5 | # undef BOOST_concept 6 | -------------------------------------------------------------------------------- /src/parser.n/options.cpp: -------------------------------------------------------------------------------- 1 | #include "parser.n/options.h" 2 | 3 | namespace ltp { 4 | namespace depparser { 5 | 6 | std::string SpecialOption::UNKNOWN = "$unk"; 7 | std::string SpecialOption::NIL = "$nil"; 8 | std::string SpecialOption::ROOT = "$root"; 9 | 10 | } // namespace depparser 11 | } // namespace ltp 12 | -------------------------------------------------------------------------------- /src/parser/options.cpp: -------------------------------------------------------------------------------- 1 | #include "parser/options.h" 2 | 3 | namespace ltp { 4 | namespace parser { 5 | 6 | ModelOptions model_opt; 7 | TrainOptions train_opt; 8 | TestOptions test_opt; 9 | FeatureOptions feat_opt; 10 | 11 | } // end for namespace parser 12 | } // end for namespace ltp 13 | 14 | -------------------------------------------------------------------------------- /src/srl/include/structure/Prediction.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/1/6. 3 | // 4 | 5 | #ifndef PROJECT_PREDICTION_H 6 | #define PROJECT_PREDICTION_H 7 | 8 | #include "utility" 9 | using namespace std; 10 | 11 | typedef vector> Prediction; 12 | 13 | #endif //PROJECT_PREDICTION_H 14 | -------------------------------------------------------------------------------- /src/srl/tool/merge.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/5/24. 3 | // 4 | 5 | #include "process/merge.h" 6 | #include "base/processLoader.h" 7 | 8 | using namespace std; 9 | int main(int argc, char * argv[]) { 10 | base::ProcessLoader processLoader(argc, argv); 11 | return processLoader.runProcess(); 12 | } -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/pending/integer_log2.hpp: -------------------------------------------------------------------------------- 1 | #ifndef BOOST_PENDING_INTEGER_LOG2_HPP 2 | #define BOOST_PENDING_INTEGER_LOG2_HPP 3 | 4 | // The header file at this path is deprecated; 5 | // use boost/integer/integer_log2.hpp instead. 6 | 7 | #include 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /src/config.h: -------------------------------------------------------------------------------- 1 | #ifndef __LTP_CONFIG_H__ 2 | #define __LTP_CONFIG_H__ 3 | 4 | #define LTP_VERSION "3.4.0" 5 | #define LTP_COPYRIGHT "(C) 2012-2017 HIT-SCIR" 6 | 7 | 8 | namespace ltp { 9 | 10 | const double EPS = 1e-8; 11 | const double NEG_INF = -1e20; 12 | 13 | } 14 | 15 | #endif // end for __LTP_CONFIG_H__ 16 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/config/abi/msvc_suffix.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright John Maddock 2003. 2 | // Use, modification and distribution are subject to the 3 | // Boost Software License, Version 1.0. (See accompanying file 4 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | #pragma pack(pop) 7 | 8 | 9 | -------------------------------------------------------------------------------- /doc/otherlanguage.rst: -------------------------------------------------------------------------------- 1 | .. _otherlang-reference-label: 2 | 3 | 使用其他语言调用ltp 4 | ======================= 5 | 6 | 如果您希望在本地使用除C++之外的其他语言调用LTP,我们针对常用语言对LTP进行了封装。 7 | 8 | * Java: `ltp4j - Language Technology Platform for Java `_ 9 | * Python:`pyltp - the python extension for LTP `_ 10 | 11 | -------------------------------------------------------------------------------- /thirdparty/dynet/dynet/globals.h: -------------------------------------------------------------------------------- 1 | #ifndef DYNET_GLOBALS_H 2 | #define DYNET_GLOBALS_H 3 | 4 | #include 5 | #include 6 | 7 | namespace dynet { 8 | 9 | class Device; 10 | 11 | extern std::mt19937* rndeng; 12 | extern std::vector devices; 13 | extern Device* default_device; 14 | 15 | } // namespace dynet 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/srl/Pi/pred.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/4/7. 3 | // 4 | 5 | #include "dynet/dynet.h" 6 | #include "base/processLoader.h" 7 | #include "process/PredSrlPi.h" 8 | 9 | using namespace std; 10 | 11 | int main(int argc, char * argv[]) { 12 | base::ProcessLoader processLoader(argc, argv); 13 | return processLoader.runProcess(); 14 | } 15 | -------------------------------------------------------------------------------- /src/srl/Pi/train.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/4/7. 3 | // 4 | 5 | #include "dynet/dynet.h" 6 | #include "base/processLoader.h" 7 | #include "process/TrainSrlPi.h" 8 | 9 | using namespace std; 10 | 11 | int main(int argc, char * argv[]) { 12 | base::ProcessLoader processLoader(argc, argv); 13 | return processLoader.runProcess(); 14 | } 15 | -------------------------------------------------------------------------------- /src/srl/Srl/pred.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/4/7. 3 | // 4 | 5 | #include "dynet/dynet.h" 6 | #include "base/processLoader.h" 7 | #include "process/PredSrlSrl.h" 8 | 9 | using namespace std; 10 | 11 | int main(int argc, char * argv[]) { 12 | base::ProcessLoader processLoader(argc, argv); 13 | return processLoader.runProcess(); 14 | } 15 | -------------------------------------------------------------------------------- /tools/train/sample/srl/example-train.srl: -------------------------------------------------------------------------------- 1 | 1 中国 中国 中国 ns ns _ _ 3 3 ATT ATT _ _ _ 2 | 2 进出口 进出口 进出口 n n _ _ 3 3 ATT ATT _ _ _ 3 | 3 银行 银行 银行 n n _ _ 7 7 SBV SBV _ _ A0 4 | 4 与 与 与 p p _ _ 3 3 ADV ADV _ _ _ 5 | 5 中国 中国 中国 ns ns _ _ 6 6 ATT ATT _ _ _ 6 | 6 银行 银行 银行 n n _ _ 4 4 POB POB _ _ _ 7 | 7 加强 加强 加强 v v _ _ 0 0 HED HED Y 加强.01 _ 8 | 8 合作 合作 合作 v v _ _ 7 7 VOB VOB _ _ A1 9 | -------------------------------------------------------------------------------- /src/srl/Srl/train.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/4/7. 3 | // 4 | 5 | #include "dynet/dynet.h" 6 | #include "base/processLoader.h" 7 | #include "process/TrainSrlSrl.h" 8 | 9 | using namespace std; 10 | 11 | int main(int argc, char * argv[]) { 12 | base::ProcessLoader processLoader(argc, argv); 13 | return processLoader.runProcess(); 14 | } 15 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/predef/detail/os_detected.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2013 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_DETAIL_OS_DETECTED 9 | #define BOOST_PREDEF_DETAIL_OS_DETECTED 1 10 | #endif 11 | -------------------------------------------------------------------------------- /tools/train/sample/srl/example-heldout.srl: -------------------------------------------------------------------------------- 1 | 1 中国 中国 中国 ns ns _ _ 3 3 ATT ATT _ _ _ 2 | 2 进出口 进出口 进出口 n n _ _ 3 3 ATT ATT _ _ _ 3 | 3 银行 银行 银行 n n _ _ 7 7 SBV SBV _ _ A0 4 | 4 与 与 与 p p _ _ 3 3 ADV ADV _ _ _ 5 | 5 中国 中国 中国 ns ns _ _ 6 6 ATT ATT _ _ _ 6 | 6 银行 银行 银行 n n _ _ 4 4 POB POB _ _ _ 7 | 7 加强 加强 加强 v v _ _ 0 0 HED HED Y 加强.01 _ 8 | 8 合作 合作 合作 v v _ _ 7 7 VOB VOB _ _ A1 9 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/predef/detail/comp_detected.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2014 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_DETAIL_COMP_DETECTED 9 | #define BOOST_PREDEF_DETAIL_COMP_DETECTED 1 10 | #endif 11 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/predef/detail/platform_detected.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2014 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_DETAIL_PLAT_DETECTED 9 | #define BOOST_PREDEF_DETAIL_PLAT_DETECTED 1 10 | #endif 11 | -------------------------------------------------------------------------------- /thirdparty/eigen/unsupported/Eigen/CXX11/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(Eigen_CXX11_HEADERS Tensor TensorSymmetry ThreadPool) 2 | 3 | install(FILES 4 | ${Eigen_CXX11_HEADERS} 5 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/CXX11 COMPONENT Devel 6 | ) 7 | 8 | install(DIRECTORY src DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen/CXX11 COMPONENT Devel FILES_MATCHING PATTERN "*.h") 9 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/config/abi/borland_suffix.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright John Maddock 2003. 2 | // Use, modification and distribution are subject to the 3 | // Boost Software License, Version 1.0. (See accompanying file 4 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | # pragma option pop 7 | #pragma nopushoptwarn 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/srl/include/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${Boost_INCLUDE_DIR}) 2 | 3 | set(base_src 4 | base/config.cpp 5 | base/debug.cpp 6 | ) 7 | 8 | add_library(base_static_lib STATIC ${base_src}) 9 | target_link_libraries(base_static_lib ${Boost_LIBRARIES}) 10 | add_library(base_shared_lib SHARED ${base_src}) 11 | target_link_libraries(base_shared_lib ${Boost_LIBRARIES}) 12 | -------------------------------------------------------------------------------- /src/srl/include/structure/DataConcept.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/1/2. 3 | // 4 | 5 | #ifndef PROJECT_DATACONCEPT_H 6 | #define PROJECT_DATACONCEPT_H 7 | 8 | #include "Data.h" 9 | 10 | namespace extractor { 11 | class DataConcept: public Data { 12 | public: 13 | static string getClassName() { return "DataConcept"; } 14 | 15 | }; 16 | } 17 | 18 | #endif //PROJECT_DATACONCEPT_H 19 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/aux_/preprocessed/bcc551/quote.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright Aleksey Gurtovoy 2000-2004 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. 5 | // (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | 9 | // Preprocessed version of "boost/mpl/quote.hpp" header 10 | // -- DO NOT modify by hand! 11 | 12 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/aux_/preprocessed/msvc60/quote.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright Aleksey Gurtovoy 2000-2004 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. 5 | // (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | 9 | // Preprocessed version of "boost/mpl/quote.hpp" header 10 | // -- DO NOT modify by hand! 11 | 12 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/aux_/preprocessed/no_ttp/quote.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright Aleksey Gurtovoy 2000-2004 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. 5 | // (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | 9 | // Preprocessed version of "boost/mpl/quote.hpp" header 10 | // -- DO NOT modify by hand! 11 | 12 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/aux_/preprocessed/bcc_pre590/quote.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright Aleksey Gurtovoy 2000-2008 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. 5 | // (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | 9 | // *Preprocessed* version of the main "quote.hpp" header 10 | // -- DO NOT modify by hand! 11 | 12 | -------------------------------------------------------------------------------- /src/srl/Pi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET(SrlPiSRC 2 | config/SrlPiConfig.h 3 | model/SrlPiModel.h 4 | ) 5 | 6 | add_executable(srl_pi_train train.cpp process/TrainSrlPi.cpp ${SrlPiSRC}) 7 | target_link_libraries(srl_pi_train dynet ${LIBS}) 8 | 9 | set_target_properties (srl_pi_train PROPERTIES 10 | OUTPUT_NAME srl_pi_train 11 | RUNTIME_OUTPUT_DIRECTORY ${TOOLS_DIR}/train/) 12 | 13 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/functional/hash_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright 2005-2009 Daniel James. 3 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 4 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | #include 7 | #if defined(BOOST_HAS_PRAGMA_ONCE) 8 | #pragma once 9 | #endif 10 | 11 | #include 12 | -------------------------------------------------------------------------------- /thirdparty/dynet/cmake/FindDyNet.cmake: -------------------------------------------------------------------------------- 1 | 2 | CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7 FATAL_ERROR) 3 | 4 | INCLUDE(FindPackageHandleStandardArgs) 5 | 6 | FIND_LIBRARY(TH_LIBRARY TH) 7 | FIND_PATH(TH_INCLUDE_DIR "TH.h" PATHS "${CMAKE_PREFIX_PATH}/include/TH") 8 | 9 | SET(TH_LIBRARIES ${TH_LIBRARY}) 10 | 11 | FIND_PACKAGE_HANDLE_STANDARD_ARGS( 12 | TH 13 | REQUIRED_ARGS 14 | TH_INCLUDE_DIR 15 | TH_LIBRARY) 16 | -------------------------------------------------------------------------------- /src/parser.n/context.h: -------------------------------------------------------------------------------- 1 | #ifndef __LTP_PARSERN_CONTEXT_H__ 2 | #define __LTP_PARSERN_CONTEXT_H__ 3 | 4 | namespace ltp { 5 | namespace depparser { 6 | 7 | struct Context { 8 | int S0, S1, S2, N0, N1, N2; 9 | int S0L, S0R, S0L2, S0R2, S0LL, S0RR; 10 | int S1L, S1R, S1L2, S1R2, S1LL, S1RR; 11 | }; 12 | 13 | } // namespace depparser 14 | } // namespace ltp 15 | 16 | #endif // end for __LTP_PARSERN_CONTEXT_H__ 17 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/aux_/preprocessed/dmc/template_arity.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright Aleksey Gurtovoy 2001-2004 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. 5 | // (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | 9 | // Preprocessed version of "boost/mpl/aux_/template_arity.hpp" header 10 | // -- DO NOT modify by hand! 11 | 12 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/aux_/preprocessed/mwcw/template_arity.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright Aleksey Gurtovoy 2001-2004 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. 5 | // (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | 9 | // Preprocessed version of "boost/mpl/aux_/template_arity.hpp" header 10 | // -- DO NOT modify by hand! 11 | 12 | -------------------------------------------------------------------------------- /thirdparty/dynet/dynet/grad-check.h: -------------------------------------------------------------------------------- 1 | #ifndef DYNET_GRAD_CHECK_H 2 | #define DYNET_GRAD_CHECK_H 3 | 4 | #include "dynet/expr.h" 5 | 6 | namespace dynet { 7 | 8 | class Model; 9 | struct ComputationGraph; 10 | 11 | // verbosity is zero for silence, one for only printing errors, two for everything 12 | bool check_grad(Model& m, expr::Expression& expr, int verbosity = 1); 13 | 14 | } // namespace dynet 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /thirdparty/jsoncpp/pkg-config/jsoncpp.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | libdir=${exec_prefix}/@LIBRARY_INSTALL_DIR@ 4 | includedir=${prefix}/@INCLUDE_INSTALL_DIR@ 5 | 6 | Name: jsoncpp 7 | Description: A C++ library for interacting with JSON 8 | Version: @JSONCPP_VERSION@ 9 | URL: https://github.com/open-source-parsers/jsoncpp 10 | Libs: -L${libdir} -ljsoncpp 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/aux_/preprocessed/plain/template_arity.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright Aleksey Gurtovoy 2001-2004 3 | // 4 | // Distributed under the Boost Software License, Version 1.0. 5 | // (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | 9 | // Preprocessed version of "boost/mpl/aux_/template_arity.hpp" header 10 | // -- DO NOT modify by hand! 11 | 12 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/predef/library/c/_prefix.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2008-2013 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_LIBRARY_C__PREFIX_H 9 | #define BOOST_PREDEF_LIBRARY_C__PREFIX_H 10 | 11 | #include 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /thirdparty/eigen/.hgignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | qrc_*cxx 3 | *.orig 4 | *.pyc 5 | *.diff 6 | diff 7 | *.save 8 | save 9 | *.old 10 | *.gmo 11 | *.qm 12 | core 13 | core.* 14 | *.bak 15 | *~ 16 | build* 17 | *.moc.* 18 | *.moc 19 | ui_* 20 | CMakeCache.txt 21 | tags 22 | .*.swp 23 | activity.png 24 | *.out 25 | *.php* 26 | *.log 27 | *.orig 28 | *.rej 29 | log 30 | patch 31 | a 32 | a.* 33 | lapack/testing 34 | lapack/reference 35 | -------------------------------------------------------------------------------- /src/segmentor/special_tokens.h: -------------------------------------------------------------------------------- 1 | #ifndef __LTP_SPECIAL_TOKENS_H__ 2 | #define __LTP_SPECIAL_TOKENS_H__ 3 | 4 | #include 5 | 6 | namespace ltp{ 7 | namespace segmentor{ 8 | const static std::string special_tokens[] = { 9 | "AT&T", 10 | "c#", 11 | "C#", 12 | "c++", 13 | "C++", 14 | }; 15 | 16 | const static size_t special_tokens_size = sizeof(special_tokens) / sizeof(std::string); 17 | } 18 | } 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/parser/parameters.h: -------------------------------------------------------------------------------- 1 | #ifndef __LTP_PARSER_PARAMETERS_H__ 2 | #define __LTP_PARSER_PARAMETERS_H__ 3 | 4 | #include "framework/parameter.h" 5 | #include "utils/math/sparsevec.h" 6 | #include "utils/math/featurevec.h" 7 | 8 | namespace ltp { 9 | namespace parser { 10 | 11 | using framework::Parameters; 12 | 13 | } // end for namespace parser 14 | } // end for namespace ltp 15 | 16 | #endif // end for __LTP_PARSER_PARAMETERS_H__ 17 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/predef/detail/_exception.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2011-2012 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_DETAIL__EXCEPTION_H 9 | #define BOOST_PREDEF_DETAIL__EXCEPTION_H 10 | 11 | #if defined(__cplusplus) 12 | #include 13 | #endif 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/detail/endian.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Rene Rivera 2 | // Distributed under the Boost Software License, Version 1.0. (See accompany- 3 | // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4 | 5 | #ifndef BOOST_DETAIL_ENDIAN_HPP 6 | #define BOOST_DETAIL_ENDIAN_HPP 7 | 8 | // Use the Predef library for the detection of endianess. 9 | #include 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /doc/begin.rst: -------------------------------------------------------------------------------- 1 | 开始使用LTP 2 | ============= 3 | 4 | 如果你是第一次使用LTP,不妨花一些时间了解LTP能帮你做什么。 5 | 6 | LTP提供了一系列中文自然语言处理工具,用户可以使用这些工具对于中文文本进行分词、词性标注、句法分析等等工作。从应用角度来看,LTP为用户提供了下列组件: 7 | 8 | * 针对单一自然语言处理任务,生成统计机器学习模型的工具 9 | * 针对单一自然语言处理任务,调用模型进行分析的编程接口 10 | * 使用流水线方式将各个分析工具结合起来,形成一套统一的中文自然语言处理系统 11 | * 系统可调用的,用于中文语言处理的模型文件 12 | * 针对单一自然语言处理任务,基于云端的编程接口 13 | 14 | 如果你的公司需要一套高性能的中文语言分析工具以处理海量的文本,或者你的在研究工作建立在一系列底层中文自然语言处理任务之上,或者你想将自己的科研成果与前沿先进工作进行对比,LTP都可能是你的选择。 15 | 16 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/predef/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2015-2016 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_VERSION_H 9 | #define BOOST_PREDEF_VERSION_H 10 | 11 | #include 12 | 13 | #define BOOST_PREDEF_VERSION BOOST_VERSION_NUMBER(1,4,1) 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /conf/ltp.cnf: -------------------------------------------------------------------------------- 1 | # resources to be loaded, valid value includes: ws, pos, ner, dp, srl 2 | target = all 3 | 4 | # path to the segment model 5 | segmentor-model = ltp_data/cws.model 6 | 7 | # path to the postag model 8 | postagger-model = ltp_data/pos.model 9 | 10 | # path to the parser model 11 | parser-model = ltp_data/parser.model 12 | 13 | # path to the ner model 14 | ner-model = ltp_data/ner.model 15 | 16 | # dir to the srl resource 17 | srl-data = ltp_data/srl/ 18 | -------------------------------------------------------------------------------- /src/splitsnt/SplitSentence.cpp: -------------------------------------------------------------------------------- 1 | #include "splitsnt/SplitSentence.h" 2 | #include "utils/strutils.hpp" 3 | #include "utils/sentsplit.hpp" 4 | 5 | using ltp::strutils::trim; 6 | 7 | SPLIT_SENTENCE_DLL_API int SplitSentence(const std::string& text, 8 | std::vector& sentences) { 9 | 10 | ltp::Chinese::split_sentence(text, sentences); 11 | for (size_t i = 0; i < sentences.size(); ++ i) { 12 | trim(sentences[i]); 13 | } 14 | return 1; 15 | } 16 | -------------------------------------------------------------------------------- /src/ner/options.h: -------------------------------------------------------------------------------- 1 | #ifndef __LTP_NER_OPTIONS_H__ 2 | #define __LTP_NER_OPTIONS_H__ 3 | 4 | #include 5 | #include "framework/options.h" 6 | 7 | namespace ltp { 8 | namespace ner { 9 | 10 | using framework::ModelOptions; 11 | using framework::TrainOptions; 12 | using framework::TestOptions; 13 | using framework::DumpOptions; 14 | 15 | } // end for namespace ner 16 | } // end for namespace ltp 17 | 18 | #endif // end for __LTP_NER_OPTIONS_H__ 19 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/predef/detail/_cassert.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2011-2012 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_DETAIL__CASSERT_H 9 | #define BOOST_PREDEF_DETAIL__CASSERT_H 10 | 11 | #if defined(__cplusplus) 12 | #include 13 | #else 14 | #include 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/srl/include/model/Model.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/1/4. 3 | // 4 | 5 | #ifndef PROJECT_MODEL_H 6 | #define PROJECT_MODEL_H 7 | 8 | #include "../base/debug.h" 9 | #include "string" 10 | using namespace std; 11 | 12 | namespace model { 13 | class Model { 14 | static string getClassName() { return "Model"; } 15 | virtual void init() = 0; 16 | virtual void save() = 0; 17 | virtual bool load() = 0; 18 | }; 19 | } 20 | 21 | #endif //PROJECT_MODEL_H 22 | -------------------------------------------------------------------------------- /src/srl/include/structure/Data.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/1/2. 3 | // 4 | 5 | #ifndef PROJECT_CORPUSDATA_H 6 | #define PROJECT_CORPUSDATA_H 7 | 8 | #include "string" 9 | using namespace std; 10 | 11 | namespace extractor { 12 | class Data { 13 | public: 14 | int upDataIndex = 0; 15 | int upDataInnerIndex = 0; 16 | static string getClassName() { return "Data"; } 17 | virtual void clear() {}; 18 | }; 19 | } 20 | 21 | #endif //PROJECT_CORPUSDATA_H 22 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/ref.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Glen Fernandes 3 | * 4 | * Distributed under the Boost Software License, Version 1.0. (See 5 | * accompanying file LICENSE_1_0.txt or copy at 6 | * http://www.boost.org/LICENSE_1_0.txt) 7 | */ 8 | 9 | #ifndef BOOST_REF_HPP 10 | #define BOOST_REF_HPP 11 | 12 | // The header file at this path is deprecated; 13 | // use boost/core/ref.hpp instead. 14 | 15 | #include 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/predef/detail/test.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2011-2012 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_DETAIL_TEST_H 9 | #define BOOST_PREDEF_DETAIL_TEST_H 10 | 11 | #if !defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS) 12 | 13 | #define BOOST_PREDEF_DECLARE_TEST(x,s) 14 | 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/swap.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Glen Fernandes 3 | * 4 | * Distributed under the Boost Software License, Version 1.0. (See 5 | * accompanying file LICENSE_1_0.txt or copy at 6 | * http://www.boost.org/LICENSE_1_0.txt) 7 | */ 8 | 9 | #ifndef BOOST_SWAP_HPP 10 | #define BOOST_SWAP_HPP 11 | 12 | // The header file at this path is deprecated; 13 | // use boost/core/swap.hpp instead. 14 | 15 | #include 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/utility/declval.hpp: -------------------------------------------------------------------------------- 1 | // declval.hpp -------------------------------------------------------------// 2 | 3 | // Copyright 2010 Vicente J. Botet Escriba 4 | 5 | // Distributed under the Boost Software License, Version 1.0. 6 | // See http://www.boost.org/LICENSE_1_0.txt 7 | 8 | #ifndef BOOST_UTILITY_DECLVAL_HPP 9 | #define BOOST_UTILITY_DECLVAL_HPP 10 | 11 | #include 12 | 13 | #endif // BOOST_UTILITY_DECLVAL_HPP 14 | -------------------------------------------------------------------------------- /thirdparty/eigen/unsupported/doc/examples/MatrixExponential.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | const double pi = std::acos(-1.0); 9 | 10 | MatrixXd A(3,3); 11 | A << 0, -pi/4, 0, 12 | pi/4, 0, 0, 13 | 0, 0, 0; 14 | std::cout << "The matrix A is:\n" << A << "\n\n"; 15 | std::cout << "The matrix exponential of A is:\n" << A.exp() << "\n\n"; 16 | } 17 | -------------------------------------------------------------------------------- /thirdparty/eigen/unsupported/doc/examples/MatrixPower.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | const double pi = std::acos(-1.0); 9 | Matrix3d A; 10 | A << cos(1), -sin(1), 0, 11 | sin(1), cos(1), 0, 12 | 0 , 0 , 1; 13 | std::cout << "The matrix A is:\n" << A << "\n\n" 14 | "The matrix power A^(pi/4) is:\n" << A.pow(pi/4) << std::endl; 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | LTP开源协议 2 | 3 | 1. 语言技术平台面向国内外大学、中科院各研究所以及个人研究者免费开放源代码,但如上述机构和个人将该平台用于商业目的(如企业合作项目等)则需要付费。 4 | 5 | 2. 除上述机构以外的企事业单位,如申请使用该平台,需付费。 6 | 7 | 3. 凡涉及付费问题,请发邮件到car@ir.hit.edu.cn洽商。 8 | 9 | 4. 如果您在LTP基础上发表论文或取得科研成果,请您在发表论文和申报成果时声明“使用了哈工大社会计算与信息检索研究中心研制的语言技术平台(LTP)”,参考文献中加入以下论文: Wanxiang Che, Zhenghua Li, Ting Liu. LTP: A Chinese Language Technology Platform. In Proceedings of the Coling 2010:Demonstrations. 2010.08, pp13-16, Beijing, China. 同时,发信给car@ir.hit.edu.cn,说明发表论文或申报成果的题目、出处等。 10 | -------------------------------------------------------------------------------- /thirdparty/eigen/unsupported/doc/examples/MatrixLogarithm.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | using std::sqrt; 9 | MatrixXd A(3,3); 10 | A << 0.5*sqrt(2), -0.5*sqrt(2), 0, 11 | 0.5*sqrt(2), 0.5*sqrt(2), 0, 12 | 0, 0, 1; 13 | std::cout << "The matrix A is:\n" << A << "\n\n"; 14 | std::cout << "The matrix logarithm of A is:\n" << A.log() << "\n"; 15 | } 16 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/utility/swap.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Glen Fernandes 3 | * 4 | * Distributed under the Boost Software License, Version 1.0. (See 5 | * accompanying file LICENSE_1_0.txt or copy at 6 | * http://www.boost.org/LICENSE_1_0.txt) 7 | */ 8 | 9 | #ifndef BOOST_UTILITY_SWAP_HPP 10 | #define BOOST_UTILITY_SWAP_HPP 11 | 12 | // The header file at this path is deprecated; 13 | // use boost/core/swap.hpp instead. 14 | 15 | #include 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/postagger/options.h: -------------------------------------------------------------------------------- 1 | #ifndef __LTP_POSTAGGER_OPTIONS_H__ 2 | #define __LTP_POSTAGGER_OPTIONS_H__ 3 | 4 | #include 5 | #include "framework/options.h" 6 | 7 | namespace ltp { 8 | namespace postagger { 9 | 10 | using framework::ModelOptions; 11 | using framework::TrainOptions; 12 | using framework::TestOptions; 13 | using framework::DumpOptions; 14 | 15 | } // end for namespace postagger 16 | } // end for namespace ltp 17 | 18 | #endif // end for __LTP_POSTAGGER_OPTIONS_H__ 19 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/align/detail/align_cxx11.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | (c) 2014 Glen Joseph Fernandes 3 | 4 | 5 | Distributed under the Boost Software 6 | License, Version 1.0. 7 | http://boost.org/LICENSE_1_0.txt 8 | */ 9 | #ifndef BOOST_ALIGN_DETAIL_ALIGN_CXX11_HPP 10 | #define BOOST_ALIGN_DETAIL_ALIGN_CXX11_HPP 11 | 12 | #include 13 | 14 | namespace boost { 15 | namespace alignment { 16 | 17 | using std::align; 18 | 19 | } /* .alignment */ 20 | } /* .boost */ 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/noncopyable.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Glen Fernandes 3 | * 4 | * Distributed under the Boost Software License, Version 1.0. (See 5 | * accompanying file LICENSE_1_0.txt or copy at 6 | * http://www.boost.org/LICENSE_1_0.txt) 7 | */ 8 | 9 | #ifndef BOOST_NONCOPYABLE_HPP 10 | #define BOOST_NONCOPYABLE_HPP 11 | 12 | // The header file at this path is deprecated; 13 | // use boost/core/noncopyable.hpp instead. 14 | 15 | #include 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /thirdparty/dynet/dynet/dynet-helper.h: -------------------------------------------------------------------------------- 1 | #ifndef DYNET_HELPER_H_ 2 | #define DYNET_HELPER_H_ 3 | 4 | #include 5 | 6 | /// helper functions 7 | 8 | namespace dynet { 9 | 10 | /** 11 | this fix a compilation problem in cygwin 12 | */ 13 | #if defined(__CYGWIN__) 14 | template 15 | inline std::string to_string(T value) 16 | { 17 | std::ostringstream os; 18 | os << value; 19 | return os.str(); 20 | } 21 | #endif 22 | 23 | } // namespace dynet 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /thirdparty/jsoncpp/include/json/json.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_JSON_H_INCLUDED 7 | #define JSON_JSON_H_INCLUDED 8 | 9 | #include "autolink.h" 10 | #include "value.h" 11 | #include "reader.h" 12 | #include "writer.h" 13 | #include "features.h" 14 | 15 | #endif // JSON_JSON_H_INCLUDED 16 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/function/function0.hpp: -------------------------------------------------------------------------------- 1 | // Boost.Function library 2 | 3 | // Copyright Douglas Gregor 2002-2003. Use, modification and 4 | // distribution is subject to the Boost Software License, Version 5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | // For more information, see http://www.boost.org 9 | 10 | #define BOOST_FUNCTION_NUM_ARGS 0 11 | #include 12 | #undef BOOST_FUNCTION_NUM_ARGS 13 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/function/function1.hpp: -------------------------------------------------------------------------------- 1 | // Boost.Function library 2 | 3 | // Copyright Douglas Gregor 2002-2003. Use, modification and 4 | // distribution is subject to the Boost Software License, Version 5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | // For more information, see http://www.boost.org 9 | 10 | #define BOOST_FUNCTION_NUM_ARGS 1 11 | #include 12 | #undef BOOST_FUNCTION_NUM_ARGS 13 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/function/function10.hpp: -------------------------------------------------------------------------------- 1 | // Boost.Function library 2 | 3 | // Copyright Douglas Gregor 2002-2003. Use, modification and 4 | // distribution is subject to the Boost Software License, Version 5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | // For more information, see http://www.boost.org 9 | 10 | #define BOOST_FUNCTION_NUM_ARGS 10 11 | #include 12 | #undef BOOST_FUNCTION_NUM_ARGS 13 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/function/function2.hpp: -------------------------------------------------------------------------------- 1 | // Boost.Function library 2 | 3 | // Copyright Douglas Gregor 2002-2003. Use, modification and 4 | // distribution is subject to the Boost Software License, Version 5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | // For more information, see http://www.boost.org 9 | 10 | #define BOOST_FUNCTION_NUM_ARGS 2 11 | #include 12 | #undef BOOST_FUNCTION_NUM_ARGS 13 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/function/function3.hpp: -------------------------------------------------------------------------------- 1 | // Boost.Function library 2 | 3 | // Copyright Douglas Gregor 2002-2003. Use, modification and 4 | // distribution is subject to the Boost Software License, Version 5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | // For more information, see http://www.boost.org 9 | 10 | #define BOOST_FUNCTION_NUM_ARGS 3 11 | #include 12 | #undef BOOST_FUNCTION_NUM_ARGS 13 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/function/function4.hpp: -------------------------------------------------------------------------------- 1 | // Boost.Function library 2 | 3 | // Copyright Douglas Gregor 2002-2003. Use, modification and 4 | // distribution is subject to the Boost Software License, Version 5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | // For more information, see http://www.boost.org 9 | 10 | #define BOOST_FUNCTION_NUM_ARGS 4 11 | #include 12 | #undef BOOST_FUNCTION_NUM_ARGS 13 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/function/function5.hpp: -------------------------------------------------------------------------------- 1 | // Boost.Function library 2 | 3 | // Copyright Douglas Gregor 2002-2003. Use, modification and 4 | // distribution is subject to the Boost Software License, Version 5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | // For more information, see http://www.boost.org 9 | 10 | #define BOOST_FUNCTION_NUM_ARGS 5 11 | #include 12 | #undef BOOST_FUNCTION_NUM_ARGS 13 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/function/function6.hpp: -------------------------------------------------------------------------------- 1 | // Boost.Function library 2 | 3 | // Copyright Douglas Gregor 2002-2003. Use, modification and 4 | // distribution is subject to the Boost Software License, Version 5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | // For more information, see http://www.boost.org 9 | 10 | #define BOOST_FUNCTION_NUM_ARGS 6 11 | #include 12 | #undef BOOST_FUNCTION_NUM_ARGS 13 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/function/function7.hpp: -------------------------------------------------------------------------------- 1 | // Boost.Function library 2 | 3 | // Copyright Douglas Gregor 2002-2003. Use, modification and 4 | // distribution is subject to the Boost Software License, Version 5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | // For more information, see http://www.boost.org 9 | 10 | #define BOOST_FUNCTION_NUM_ARGS 7 11 | #include 12 | #undef BOOST_FUNCTION_NUM_ARGS 13 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/function/function8.hpp: -------------------------------------------------------------------------------- 1 | // Boost.Function library 2 | 3 | // Copyright Douglas Gregor 2002-2003. Use, modification and 4 | // distribution is subject to the Boost Software License, Version 5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | // For more information, see http://www.boost.org 9 | 10 | #define BOOST_FUNCTION_NUM_ARGS 8 11 | #include 12 | #undef BOOST_FUNCTION_NUM_ARGS 13 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/function/function9.hpp: -------------------------------------------------------------------------------- 1 | // Boost.Function library 2 | 3 | // Copyright Douglas Gregor 2002-2003. Use, modification and 4 | // distribution is subject to the Boost Software License, Version 5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | // For more information, see http://www.boost.org 9 | 10 | #define BOOST_FUNCTION_NUM_ARGS 9 11 | #include 12 | #undef BOOST_FUNCTION_NUM_ARGS 13 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/align/align.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | (c) 2014-2015 Glen Joseph Fernandes 3 | 4 | 5 | Distributed under the Boost Software 6 | License, Version 1.0. 7 | http://boost.org/LICENSE_1_0.txt 8 | */ 9 | #ifndef BOOST_ALIGN_ALIGN_HPP 10 | #define BOOST_ALIGN_ALIGN_HPP 11 | 12 | #include 13 | 14 | #if !defined(BOOST_NO_CXX11_STD_ALIGN) 15 | #include 16 | #else 17 | #include 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/predef/other.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2013-2015 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #if !defined(BOOST_PREDEF_OTHER_H) || defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS) 9 | #ifndef BOOST_PREDEF_OTHER_H 10 | #define BOOST_PREDEF_OTHER_H 11 | #endif 12 | 13 | #include 14 | /*#include */ 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/utility/addressof.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Glen Fernandes 3 | * 4 | * Distributed under the Boost Software License, Version 1.0. (See 5 | * accompanying file LICENSE_1_0.txt or copy at 6 | * http://www.boost.org/LICENSE_1_0.txt) 7 | */ 8 | 9 | #ifndef BOOST_UTILITY_ADDRESSOF_HPP 10 | #define BOOST_UTILITY_ADDRESSOF_HPP 11 | 12 | // The header file at this path is deprecated; 13 | // use boost/core/addressof.hpp instead. 14 | 15 | #include 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/utility/enable_if.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Glen Fernandes 3 | * 4 | * Distributed under the Boost Software License, Version 1.0. (See 5 | * accompanying file LICENSE_1_0.txt or copy at 6 | * http://www.boost.org/LICENSE_1_0.txt) 7 | */ 8 | 9 | #ifndef BOOST_UTILITY_ENABLE_IF_HPP 10 | #define BOOST_UTILITY_ENABLE_IF_HPP 11 | 12 | // The header file at this path is deprecated; 13 | // use boost/core/enable_if.hpp instead. 14 | 15 | #include 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/srl/common/Const.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/4/7. 3 | // 4 | 5 | #ifndef PROJECT_CONST_H 6 | #define PROJECT_CONST_H 7 | 8 | #include "string" 9 | #include "vector" 10 | using namespace std; 11 | const string BLANK_WORD = ""; 12 | const string UNK_WORD = ""; 13 | const string NIL_LABEL = "_"; 14 | const string PRED_LABEL = "Y"; 15 | const string ROOT_MARK = ""; 16 | 17 | 18 | const string S_QTY_ARG = "QTY"; 19 | const vector S_QTY_POS_PAT = {"ad", "cd", "m", "q"}; 20 | 21 | #endif //PROJECT_CONST_H -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/checked_delete.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Glen Fernandes 3 | * 4 | * Distributed under the Boost Software License, Version 1.0. (See 5 | * accompanying file LICENSE_1_0.txt or copy at 6 | * http://www.boost.org/LICENSE_1_0.txt) 7 | */ 8 | 9 | #ifndef BOOST_CHECKED_DELETE_HPP 10 | #define BOOST_CHECKED_DELETE_HPP 11 | 12 | // The header file at this path is deprecated; 13 | // use boost/core/checked_delete.hpp instead. 14 | 15 | #include 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/predef/hardware.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Charly Chevalier 2015 3 | Copyright Joel Falcou 2015 4 | Distributed under the Boost Software License, Version 1.0. 5 | (See accompanying file LICENSE_1_0.txt or copy at 6 | http://www.boost.org/LICENSE_1_0.txt) 7 | */ 8 | 9 | #if !defined(BOOST_PREDEF_HARDWARE_H) || defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS) 10 | #ifndef BOOST_PREDEF_HARDWARE_H 11 | #define BOOST_PREDEF_HARDWARE_H 12 | #endif 13 | 14 | #include 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/predef/library.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2008-2015 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #if !defined(BOOST_PREDEF_LIBRARY_H) || defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS) 9 | #ifndef BOOST_PREDEF_LIBRARY_H 10 | #define BOOST_PREDEF_LIBRARY_H 11 | #endif 12 | 13 | #include 14 | #include 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/postagger/settings.h: -------------------------------------------------------------------------------- 1 | #ifndef __LTP_POSTAGGER_SETTINGS_H__ 2 | #define __LTP_POSTAGGER_SETTINGS_H__ 3 | 4 | #include 5 | 6 | namespace ltp { 7 | namespace postagger { 8 | 9 | const std::string BOS = "_bos_"; 10 | const std::string EOS = "_eos_"; 11 | const std::string BOT = "_bot_"; 12 | const std::string EOT = "_eot_"; 13 | const std::string BOC = "_boc_"; 14 | const std::string EOC = "_eoc_"; 15 | 16 | } // end for namespace postagger 17 | } // end for namespace ltp 18 | 19 | #endif // end for __LTP_POSTAGGER_SETTINGS_H__ 20 | -------------------------------------------------------------------------------- /thirdparty/dynet/MEM.notes: -------------------------------------------------------------------------------- 1 | The code that computes the l2 norm of the gradient is going to need 2 | scratch space on every device that DYNET is using that has a parameter. 3 | 1) devices should know whether they have parameters/gradients 4 | 5 | alignment code is hidden away. it's all hard coded, but it looks like 6 | Intel at least is getting more foregiving about alingment problems so 7 | we might not notice opportunities for speedups if something changes. 8 | GPU memory is aligned mostly by CUDA 9 | 10 | the MP stuff needs to be tested by Austin. 11 | -------------------------------------------------------------------------------- /src/srl/Srl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET(SrlSrlSRC 2 | config/SrlSrlConfig.h 3 | model/SrlSrlModel.h 4 | model/SrlSrlModel.cpp) 5 | 6 | add_executable(srl_srl_train train.cpp process/TrainSrlSrl.cpp ${SrlSrlSRC}) 7 | target_link_libraries(srl_srl_train dynet ${LIBS}) 8 | 9 | set_target_properties (srl_srl_train PROPERTIES 10 | OUTPUT_NAME srl_srl_train 11 | RUNTIME_OUTPUT_DIRECTORY ${TOOLS_DIR}/train/) 12 | 13 | add_library(srl_srl_static_lib STATIC ${SrlSrlSRC}) 14 | target_link_libraries(srl_srl_static_lib dynet ${LIBS}) 15 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/config/platform/amigaos.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright John Maddock 2002. 2 | // Use, modification and distribution are subject to the 3 | // Boost Software License, Version 1.0. (See accompanying file 4 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org for most recent version. 7 | 8 | #define BOOST_PLATFORM "AmigaOS" 9 | 10 | #define BOOST_DISABLE_THREADS 11 | #define BOOST_NO_CWCHAR 12 | #define BOOST_NO_STD_WSTRING 13 | #define BOOST_NO_INTRINSIC_WCHAR_T 14 | 15 | 16 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/next.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_NEXT_HPP_INCLUDED 3 | #define BOOST_MPL_NEXT_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #include 18 | 19 | #endif // BOOST_MPL_NEXT_HPP_INCLUDED 20 | -------------------------------------------------------------------------------- /thirdparty/eigen/unsupported/doc/examples/MatrixPower_optimal.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | Matrix4cd A = Matrix4cd::Random(); 9 | MatrixPower Apow(A); 10 | 11 | std::cout << "The matrix A is:\n" << A << "\n\n" 12 | "A^3.1 is:\n" << Apow(3.1) << "\n\n" 13 | "A^3.3 is:\n" << Apow(3.3) << "\n\n" 14 | "A^3.7 is:\n" << Apow(3.7) << "\n\n" 15 | "A^3.9 is:\n" << Apow(3.9) << std::endl; 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /thirdparty/eigen/unsupported/doc/examples/MatrixSquareRoot.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | const double pi = std::acos(-1.0); 9 | 10 | MatrixXd A(2,2); 11 | A << cos(pi/3), -sin(pi/3), 12 | sin(pi/3), cos(pi/3); 13 | std::cout << "The matrix A is:\n" << A << "\n\n"; 14 | std::cout << "The matrix square root of A is:\n" << A.sqrt() << "\n\n"; 15 | std::cout << "The square of the last matrix is:\n" << A.sqrt() * A.sqrt() << "\n"; 16 | } 17 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/chrono/chrono.hpp: -------------------------------------------------------------------------------- 1 | // chrono.hpp --------------------------------------------------------------// 2 | 3 | // Copyright 2009-2011 Vicente J. Botet Escriba 4 | 5 | // Distributed under the Boost Software License, Version 1.0. 6 | // See http://www.boost.org/LICENSE_1_0.txt 7 | 8 | #ifndef BOOST_CHRONO_CHRONO_HPP 9 | #define BOOST_CHRONO_CHRONO_HPP 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #endif // BOOST_CHRONO_CHRONO_HPP 16 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/prior.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_PRIOR_HPP_INCLUDED 3 | #define BOOST_MPL_PRIOR_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #include 18 | 19 | #endif // BOOST_MPL_PRIOR_HPP_INCLUDED 20 | -------------------------------------------------------------------------------- /doc/intro.rst: -------------------------------------------------------------------------------- 1 | 简介 2 | ===== 3 | 4 | 语言技术平台(Language Technology Platform,LTP)是 `哈工大社会计算与信息检索研究中心 `_ 历时十年开发的一整套中文语言处理系统。LTP制定了基于XML的语言处理结果表示,并在此基础上提供了一整套自底向上的丰富而且高效的中文语言处理模块(包括词法、句法、语义等6项中文处理核心技术),以及基于动态链接库(Dynamic Link Library, DLL)的应用程序接口,可视化工具,并且能够以网络服务(Web Service)的形式进行使用。 5 | 6 | 从2006年9月5日开始该平台对外免费共享目标代码,截止目前,已经有国内外400多家研究单位共享了LTP,也有国内外多家商业公司购买了LTP,用于实际的商业项目中。2010年12月获得中国中文信息学会颁发的行业最高奖项:“钱伟长中文信息处理科学技术奖”一等奖。 7 | 8 | 2011年6月1日,为了与业界同行共同研究和开发中文信息处理核心技术,我中心正式将LTP开源。 9 | 10 | 2013年9月1日,语言技术平台云端服务" `语言云 `_ "正式上线。 11 | 12 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/detail/scoped_enum_emulation.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Andrey Semashev 3 | * 4 | * Distributed under the Boost Software License, Version 1.0. (See 5 | * accompanying file LICENSE_1_0.txt or copy at 6 | * http://www.boost.org/LICENSE_1_0.txt) 7 | */ 8 | 9 | #ifndef BOOST_DETAIL_SCOPED_ENUM_EMULATION_HPP 10 | #define BOOST_DETAIL_SCOPED_ENUM_EMULATION_HPP 11 | 12 | // The header file at this path is deprecated; 13 | // use boost/core/scoped_enum.hpp instead. 14 | 15 | #include 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /doc/license.rst: -------------------------------------------------------------------------------- 1 | 开源协议 2 | ======== 3 | 4 | 1. 语言技术平台面向国内外大学、中科院各研究所以及个人研究者免费开放源代码,但如上述机构和个人将该平台用于商业目的(如企业合作项目等)则需要付费。 5 | 6 | 2. 除上述机构以外的企事业单位,如申请使用该平台,需付费。 7 | 8 | 3. 凡涉及付费问题,请发邮件到 `car@ir.hit.edu.cn `_ 洽商。 9 | 10 | 4. 如果您在LTP基础上发表论文或取得科研成果,请您在发表论文和申报成果时声明“使用了哈工大社会计算与信息检索研究中心研制的语言技术平台(LTP)”,参考文献中加入以下论文: Wanxiang Che, Zhenghua Li, Ting Liu. LTP: A Chinese Language Technology Platform. In Proceedings of the Coling 2010:Demonstrations. 2010.08, pp13-16, Beijing, China. 同时,发信给 `car@ir.hit.edu.cn `_ ,说明发表论文或申报成果的题目、出处等。 11 | -------------------------------------------------------------------------------- /src/srl/common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(CommonSRC 2 | model/AffineTransformModelBuilder.cpp 3 | model/CNN1dLayerBuilder.cpp 4 | process/LabelModelSGDSeqTrainer.h 5 | model/PiSrlModel.h 6 | structure/SrlPiSample.cpp 7 | structure/WordEmbBuilder.h 8 | model/RNNModelBuilder.h model/BiRNNModelBuilder.h) 9 | 10 | 11 | add_library(common_static_lib STATIC ${CommonSRC}) 12 | target_link_libraries(common_static_lib ${LIBS}) 13 | #add_library(common_shared_lib SHARED ${CommonSRC}) 14 | #target_link_libraries(common_shared_lib ${LIBS}) -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/move/detail/config_end.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // (C) Copyright Ion Gaztanaga 2012-2012. Distributed under the Boost 4 | // Software License, Version 1.0. (See accompanying file 5 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // See http://www.boost.org/libs/move for documentation. 8 | // 9 | ////////////////////////////////////////////////////////////////////////////// 10 | #if defined BOOST_MSVC 11 | # pragma warning (pop) 12 | #endif 13 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/config/platform/cray.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright John Maddock 2011. 2 | // Use, modification and distribution are subject to the 3 | // Boost Software License, Version 1.0. (See accompanying file 4 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | 7 | // See http://www.boost.org for most recent version. 8 | 9 | // SGI Irix specific config options: 10 | 11 | #define BOOST_PLATFORM "Cray" 12 | 13 | // boilerplate code: 14 | #define BOOST_HAS_UNISTD_H 15 | #include 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /thirdparty/dynet/dynet/pretrain.h: -------------------------------------------------------------------------------- 1 | #ifndef DYNET_PRETRAIN_H 2 | #define DYNET_PRETRAIN_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "dynet/dict.h" 8 | #include "dynet/model.h" 9 | 10 | namespace dynet { 11 | 12 | void save_pretrained_embeddings(const std::string& fname, 13 | const Dict& d, 14 | const LookupParameter& lp); 15 | 16 | void read_pretrained_embeddings(const std::string& fname, 17 | Dict& d, 18 | std::unordered_map>& vectors); 19 | 20 | } // namespace dynet 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/srl/include/base/process.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/1/5. 3 | // 4 | 5 | #ifndef PROJECT_PROCESS_H 6 | #define PROJECT_PROCESS_H 7 | 8 | #include "config.h" 9 | namespace base { 10 | template 11 | class Process { 12 | public: 13 | ConfigClass & config; 14 | int returnNum = 0; 15 | 16 | Process(ConfigClass &config): config(config) {} 17 | 18 | virtual void main() = 0; 19 | 20 | static ConfigClass createConfig() { 21 | return ConfigClass(); 22 | } 23 | }; 24 | } 25 | 26 | 27 | 28 | #endif //PROJECT_PROCESS_H 29 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/iterator.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Beman Dawes 2000. Distributed under the Boost 2 | // Software License, Version 1.0. (See accompanying file 3 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4 | 5 | #ifndef BOOST_ITERATOR_HPP 6 | #define BOOST_ITERATOR_HPP 7 | 8 | // This header is obsolete and will be deprecated. 9 | 10 | #include 11 | #include // std::ptrdiff_t 12 | 13 | namespace boost 14 | { 15 | 16 | using std::iterator; 17 | 18 | } // namespace boost 19 | 20 | #endif // BOOST_ITERATOR_HPP 21 | -------------------------------------------------------------------------------- /thirdparty/dynet/dynet/rnn-state-machine.cc: -------------------------------------------------------------------------------- 1 | #include "dynet/rnn-state-machine.h" 2 | 3 | #include 4 | 5 | #include "dynet/dynet.h" 6 | 7 | using namespace std; 8 | 9 | namespace dynet { 10 | 11 | void RNNStateMachine::failure(RNNOp op) { 12 | ostringstream oss; oss << "State transition error: currently in state " << q_ << " but received operation " << op; 13 | throw std::invalid_argument(oss.str()); 14 | } 15 | 16 | DYNET_SERIALIZE_COMMIT(RNNStateMachine, DYNET_SERIALIZE_DEFINE(q_)) 17 | DYNET_SERIALIZE_IMPL(RNNStateMachine) 18 | 19 | } // namespace dynet 20 | 21 | -------------------------------------------------------------------------------- /src/ner/settings.h: -------------------------------------------------------------------------------- 1 | #ifndef __LTP_NER_SETTINGS_H__ 2 | #define __LTP_NER_SETTINGS_H__ 3 | 4 | #include 5 | 6 | namespace ltp { 7 | namespace ner { 8 | 9 | const std::string BOS = "_bos_"; 10 | const std::string EOS = "_eos_"; 11 | const std::string BOP = "_bop_"; 12 | const std::string EOP = "_eop_"; 13 | const std::string OTHER = "O"; 14 | 15 | const int __num_pos_types__ = 4; 16 | static const char* __pos_types__[] = { "B", "I", "E", "S", }; 17 | 18 | } // end for namespace ner 19 | } // end for namespace ltp 20 | 21 | #endif // end for __LTP_NER_SETTINGS_H__ 22 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/container/detail/config_end.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // (C) Copyright Ion Gaztanaga 2005-2013. Distributed under the Boost 4 | // Software License, Version 1.0. (See accompanying file 5 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // See http://www.boost.org/libs/container for documentation. 8 | // 9 | ////////////////////////////////////////////////////////////////////////////// 10 | #if defined BOOST_MSVC 11 | #pragma warning (pop) 12 | #endif 13 | 14 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/detail/no_exceptions_support.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Glen Fernandes 3 | * 4 | * Distributed under the Boost Software License, Version 1.0. (See 5 | * accompanying file LICENSE_1_0.txt or copy at 6 | * http://www.boost.org/LICENSE_1_0.txt) 7 | */ 8 | 9 | #ifndef BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP 10 | #define BOOST_DETAIL_NO_EXCEPTIONS_SUPPORT_HPP 11 | 12 | // The header file at this path is deprecated; 13 | // use boost/core/no_exceptions_support.hpp instead. 14 | 15 | #include 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/weak_ptr.hpp: -------------------------------------------------------------------------------- 1 | #ifndef BOOST_WEAK_PTR_HPP_INCLUDED 2 | #define BOOST_WEAK_PTR_HPP_INCLUDED 3 | 4 | // 5 | // weak_ptr.hpp 6 | // 7 | // Copyright (c) 2001, 2002, 2003 Peter Dimov 8 | // 9 | // Distributed under the Boost Software License, Version 1.0. 10 | // See accompanying file LICENSE_1_0.txt or copy at 11 | // http://www.boost.org/LICENSE_1_0.txt 12 | // 13 | // See http://www.boost.org/libs/smart_ptr/weak_ptr.htm for documentation. 14 | // 15 | 16 | #include 17 | 18 | #endif // #ifndef BOOST_WEAK_PTR_HPP_INCLUDED 19 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/predef/language.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2011-2015 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #if !defined(BOOST_PREDEF_LANGUAGE_H) || defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS) 9 | #ifndef BOOST_PREDEF_LANGUAGE_H 10 | #define BOOST_PREDEF_LANGUAGE_H 11 | #endif 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/type.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright David Abrahams 2001. 2 | // Distributed under the Boost Software License, Version 1.0. (See 3 | // accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | #ifndef BOOST_TYPE_DWA20010120_HPP 7 | # define BOOST_TYPE_DWA20010120_HPP 8 | 9 | namespace boost { 10 | 11 | // Just a simple "type envelope". Useful in various contexts, mostly to work 12 | // around some MSVC deficiencies. 13 | template 14 | struct type {}; 15 | 16 | } 17 | 18 | #endif // BOOST_TYPE_DWA20010120_HPP 19 | -------------------------------------------------------------------------------- /thirdparty/eigen/Eigen/src/misc/lapacke_mangling.h: -------------------------------------------------------------------------------- 1 | #ifndef LAPACK_HEADER_INCLUDED 2 | #define LAPACK_HEADER_INCLUDED 3 | 4 | #ifndef LAPACK_GLOBAL 5 | #if defined(LAPACK_GLOBAL_PATTERN_LC) || defined(ADD_) 6 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 7 | #elif defined(LAPACK_GLOBAL_PATTERN_UC) || defined(UPPER) 8 | #define LAPACK_GLOBAL(lcname,UCNAME) UCNAME 9 | #elif defined(LAPACK_GLOBAL_PATTERN_MC) || defined(NOCHANGE) 10 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname 11 | #else 12 | #define LAPACK_GLOBAL(lcname,UCNAME) lcname##_ 13 | #endif 14 | #endif 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/scoped_ptr.hpp: -------------------------------------------------------------------------------- 1 | #ifndef BOOST_SCOPED_PTR_HPP_INCLUDED 2 | #define BOOST_SCOPED_PTR_HPP_INCLUDED 3 | 4 | // (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. 5 | // Copyright (c) 2001, 2002 Peter Dimov 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See 8 | // accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // http://www.boost.org/libs/smart_ptr/scoped_ptr.htm 12 | // 13 | 14 | #include 15 | 16 | #endif // #ifndef BOOST_SCOPED_PTR_HPP_INCLUDED 17 | -------------------------------------------------------------------------------- /src/srl/include/extractor/AbstractExtractor.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/1/4. 3 | // 4 | 5 | #ifndef PROJECT_ABSTRACTEXTRACTOR_H 6 | #define PROJECT_ABSTRACTEXTRACTOR_H 7 | 8 | #include "string" 9 | using namespace std; 10 | 11 | namespace extractor { 12 | template 13 | class AbstractExtractor { 14 | 15 | virtual void init(StartClass & start) = 0; 16 | 17 | virtual EndClass run() = 0; 18 | 19 | static string getClassName() { 20 | return "AbstractExtractor"; 21 | } 22 | }; 23 | } 24 | 25 | #endif //PROJECT_ABSTRACTEXTRACTOR_H 26 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/preprocessor.hpp: -------------------------------------------------------------------------------- 1 | # /* Copyright (C) 2001 2 | # * Housemarque Oy 3 | # * http://www.housemarque.com 4 | # * 5 | # * Distributed under the Boost Software License, Version 1.0. (See 6 | # * accompanying file LICENSE_1_0.txt or copy at 7 | # * http://www.boost.org/LICENSE_1_0.txt) 8 | # */ 9 | # 10 | # /* Revised by Paul Mensonides (2002) */ 11 | # 12 | # /* See http://www.boost.org/libs/preprocessor for documentation. */ 13 | # 14 | # ifndef BOOST_PREPROCESSOR_HPP 15 | # define BOOST_PREPROCESSOR_HPP 16 | # 17 | # include 18 | # 19 | # endif 20 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/scoped_array.hpp: -------------------------------------------------------------------------------- 1 | #ifndef BOOST_SCOPED_ARRAY_HPP_INCLUDED 2 | #define BOOST_SCOPED_ARRAY_HPP_INCLUDED 3 | 4 | // (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. 5 | // Copyright (c) 2001, 2002 Peter Dimov 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. (See 8 | // accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // http://www.boost.org/libs/smart_ptr/scoped_array.htm 12 | // 13 | 14 | #include 15 | 16 | #endif // #ifndef BOOST_SCOPED_ARRAY_HPP_INCLUDED 17 | -------------------------------------------------------------------------------- /src/segmentor/options.h: -------------------------------------------------------------------------------- 1 | #ifndef __LTP_SEGMENTOR_OPTIONS_H__ 2 | #define __LTP_SEGMENTOR_OPTIONS_H__ 3 | 4 | #include 5 | #include "framework/options.h" 6 | 7 | namespace ltp { 8 | namespace segmentor { 9 | 10 | using framework::ModelOptions; 11 | using framework::TestOptions; 12 | using framework::DumpOptions; 13 | 14 | struct TrainOptions: public framework::TrainOptions { 15 | bool dump_model_details; 16 | bool enable_incremental_training; 17 | }; 18 | 19 | } // end for namespace segmentor 20 | } // end for namespace ltp 21 | 22 | #endif // end for __LTP_SEGMENTOR_OPTIONS_H__ 23 | -------------------------------------------------------------------------------- /src/splitsnt/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories (${SOURCE_DIR}) 2 | 3 | set (splitsnt_VERSION "0.0.1") 4 | 5 | add_library (splitsnt_static_lib SplitSentence.h SplitSentence.cpp) 6 | 7 | set_target_properties (splitsnt_static_lib PROPERTIES 8 | OUTPUT_NAME splitsnt 9 | PREFIX "lib") 10 | 11 | add_library (splitsnt_shared_lib SHARED SplitSentence.cpp) 12 | 13 | set_target_properties (splitsnt_shared_lib PROPERTIES 14 | VERSION ${splitsnt_VERSION} 15 | OUTPUT_NAME splitsnt) 16 | 17 | configure_file ( 18 | SplitSentence.h 19 | ${INCLUDE_OUTPUT_PATH}/ltp/SplitSentence.h) 20 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/intrusive/detail/config_end.hpp: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // 3 | // (C) Copyright Ion Gaztanaga 2006-2013 4 | // 5 | // Distributed under the Boost Software License, Version 1.0. 6 | // (See accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // See http://www.boost.org/libs/intrusive for documentation. 10 | // 11 | ///////////////////////////////////////////////////////////////////////////// 12 | 13 | #if defined BOOST_MSVC 14 | #pragma warning (pop) 15 | #endif 16 | -------------------------------------------------------------------------------- /thirdparty/boost/libs/regex/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRECTORIES( ./ 2 | ${THIRDPARTY_DIR}/boost/include/ ) 3 | 4 | set (boost_regex_VERSION "1.61") 5 | 6 | FILE(GLOB boost_regex_SRC src/*.cpp src/*.hpp) 7 | 8 | add_library(boost_regex_static_lib STATIC ${boost_regex_SRC}) 9 | 10 | set_target_properties (boost_regex_static_lib PROPERTIES 11 | OUTPUT_NAME boost_regex 12 | PREFIX "lib") 13 | 14 | add_library(boost_regex_shared_lib SHARED ${boost_regex_SRC}) 15 | 16 | set_target_properties (boost_regex_shared_lib PROPERTIES 17 | VERSION ${boost_regex_VERSION} 18 | OUTPUT_NAME boost_regex) 19 | -------------------------------------------------------------------------------- /src/srl/common/model/AffineTransformModelBuilder.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/5/11. 3 | // 4 | 5 | #include "AffineTransformModelBuilder.h" 6 | 7 | 8 | Expression AffineTransformModelBuilder::forward(dynet::ComputationGraph &hg, const vector& features) { 9 | assert(features.size() == mulParams.size()); 10 | vector tranParams; 11 | tranParams.push_back(parameter(hg, bias)); 12 | for (int i = 0; i < mulParams.size(); ++i) { 13 | tranParams.push_back(parameter(hg, mulParams[i])); 14 | tranParams.push_back(features[i]); 15 | } 16 | return affine_transform(tranParams); 17 | } -------------------------------------------------------------------------------- /src/srl/include/structure/DataFileName.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/1/2. 3 | // 4 | 5 | #ifndef PROJECT_DATAFILENAME_H 6 | #define PROJECT_DATAFILENAME_H 7 | 8 | #include "string" 9 | #include "iostream" 10 | #include "Data.h" 11 | using namespace std; 12 | namespace extractor { 13 | class DataFileName: public Data { 14 | public: 15 | static string getClassName() { return "DataFileName"; } 16 | string fileName; 17 | DataFileName() {}; 18 | 19 | DataFileName(const string &fileNameString) { 20 | fileName = fileNameString; 21 | }; 22 | }; 23 | } 24 | #endif //PROJECT_DATAFILENAME_H 25 | -------------------------------------------------------------------------------- /src/srl/include/structure/DataFileContext.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/1/2. 3 | // 4 | 5 | #ifndef PROJECT_DATAFILECONTEXT_H 6 | #define PROJECT_DATAFILECONTEXT_H 7 | 8 | #include "vector" 9 | #include "string" 10 | #include "iostream" 11 | #include "Data.h" 12 | using namespace std; 13 | namespace extractor { 14 | class DataFileContext : public Data { 15 | public: 16 | static string getClassName() { return "DataFileContext"; } 17 | vector data; 18 | DataFileContext() {}; 19 | DataFileContext(vector& data): data(data) {} 20 | }; 21 | } 22 | 23 | #endif //PROJECT_DATAFILECONTEXT_H 24 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/type_traits/type_identity.hpp: -------------------------------------------------------------------------------- 1 | #ifndef BOOST_TYPE_TRAITS_TYPE_IDENTITY_HPP_INCLUDED 2 | #define BOOST_TYPE_TRAITS_TYPE_IDENTITY_HPP_INCLUDED 3 | 4 | // 5 | // Copyright 2015 Peter Dimov 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt 10 | // 11 | 12 | namespace boost 13 | { 14 | 15 | template struct type_identity 16 | { 17 | typedef T type; 18 | }; 19 | 20 | } // namespace boost 21 | 22 | #endif // #ifndef BOOST_TYPE_TRAITS_TYPE_IDENTITY_HPP_INCLUDED 23 | -------------------------------------------------------------------------------- /thirdparty/eigen/unsupported/doc/examples/MatrixFunction.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | std::complex expfn(std::complex x, int) 7 | { 8 | return std::exp(x); 9 | } 10 | 11 | int main() 12 | { 13 | const double pi = std::acos(-1.0); 14 | 15 | MatrixXd A(3,3); 16 | A << 0, -pi/4, 0, 17 | pi/4, 0, 0, 18 | 0, 0, 0; 19 | 20 | std::cout << "The matrix A is:\n" << A << "\n\n"; 21 | std::cout << "The matrix exponential of A is:\n" 22 | << A.matrixFunction(expfn) << "\n\n"; 23 | } 24 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/config/compiler/compaq_cxx.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright John Maddock 2001 - 2003. 2 | // Use, modification and distribution are subject to the 3 | // Boost Software License, Version 1.0. (See accompanying file 4 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org for most recent version. 7 | 8 | // Tru64 C++ compiler setup (now HP): 9 | 10 | #define BOOST_COMPILER "HP Tru64 C++ " BOOST_STRINGIZE(__DECCXX_VER) 11 | 12 | #include "boost/config/compiler/common_edg.hpp" 13 | 14 | // 15 | // versions check: 16 | // Nothing to do here? 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/aux_/config/workaround.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_AUX_CONFIG_WORKAROUND_HPP_INCLUDED 3 | #define BOOST_MPL_AUX_CONFIG_WORKAROUND_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2002-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #include 18 | 19 | #endif // BOOST_MPL_AUX_CONFIG_WORKAROUND_HPP_INCLUDED 20 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/logical.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_LOGICAL_HPP_INCLUDED 3 | #define BOOST_MPL_LOGICAL_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | #endif // BOOST_MPL_LOGICAL_HPP_INCLUDED 22 | -------------------------------------------------------------------------------- /thirdparty/boost/libs/smart_ptr/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRECTORIES( ./ 2 | ${THIRDPARTY_DIR}/boost/include/ ) 3 | 4 | set (boost_smart_ptr_VERSION "1.61") 5 | 6 | FILE(GLOB boost_smart_ptr_SRC src/*.cpp) 7 | 8 | add_library(boost_smart_ptr_static_lib STATIC ${boost_smart_ptr_SRC}) 9 | add_library(boost_smart_ptr_shared_lib SHARED ${boost_smart_ptr_SRC}) 10 | set_target_properties (boost_smart_ptr_static_lib PROPERTIES 11 | OUTPUT_NAME boost_smart_ptr 12 | PREFIX "lib") 13 | set_target_properties (boost_smart_ptr_shared_lib PROPERTIES 14 | VERSION ${boost_smart_ptr_VERSION} 15 | OUTPUT_NAME boost_smart_ptr) 16 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/aux_/config/msvc.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_AUX_CONFIG_MSVC_HPP_INCLUDED 3 | #define BOOST_MPL_AUX_CONFIG_MSVC_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2002-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | 18 | // BOOST_MSVC is defined here: 19 | #include 20 | 21 | #endif // BOOST_MPL_AUX_CONFIG_MSVC_HPP_INCLUDED 22 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/less.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_LESS_HPP_INCLUDED 3 | #define BOOST_MPL_LESS_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #define AUX778076_OP_NAME less 18 | #define AUX778076_OP_TOKEN < 19 | #include 20 | 21 | #endif // BOOST_MPL_LESS_HPP_INCLUDED 22 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/plus.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_PLUS_HPP_INCLUDED 3 | #define BOOST_MPL_PLUS_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #define AUX778076_OP_NAME plus 18 | #define AUX778076_OP_TOKEN + 19 | #include 20 | 21 | #endif // BOOST_MPL_PLUS_HPP_INCLUDED 22 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/optional.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003, Fernando Luis Cacciola Carballal. 2 | // 3 | // Use, modification, and distribution is subject to the Boost Software 4 | // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // See http://www.boost.org/libs/optional for documentation. 8 | // 9 | // You are welcome to contact the author at: 10 | // fernando_cacciola@hotmail.com 11 | // 12 | #ifndef BOOST_OPTIONAL_FLC_19NOV2002_HPP 13 | #define BOOST_OPTIONAL_FLC_19NOV2002_HPP 14 | 15 | #include "boost/optional/optional.hpp" 16 | 17 | #endif 18 | 19 | -------------------------------------------------------------------------------- /src/unittest/unittest.cpp: -------------------------------------------------------------------------------- 1 | #define private public 2 | #define protected public 3 | #include 4 | #include "utils_chartypes_unittest.cpp" 5 | #include "utils_codecs_unittest.cpp" 6 | #include "utils_smartmap_unittest.cpp" 7 | #include "utils_sbcdbc_unittest.cpp" 8 | #include "utils_strpaste_unittest.cpp" 9 | #include "utils_strutils_unittest.cpp" 10 | #include "utils_sentsplit_unittest.cpp" 11 | #include "utils_template_unittest.cpp" 12 | #include "segmentor_unittest.cpp" 13 | #include "parser_unittest.cpp" 14 | 15 | int main(int argc, char ** argv) { 16 | ::testing::InitGoogleTest(&argc, argv); 17 | return RUN_ALL_TESTS(); 18 | } 19 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/interprocess/detail/config_external_end.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // (C) Copyright Ion Gaztanaga 2012-2012. Distributed under the Boost 4 | // Software License, Version 1.0. (See accompanying file 5 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // See http://www.boost.org/libs/interprocess for documentation. 8 | // 9 | ////////////////////////////////////////////////////////////////////////////// 10 | #if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 406) 11 | # pragma GCC diagnostic pop 12 | #endif 13 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/minus.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_MINUS_HPP_INCLUDED 3 | #define BOOST_MPL_MINUS_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #define AUX778076_OP_NAME minus 18 | #define AUX778076_OP_TOKEN - 19 | #include 20 | 21 | #endif // BOOST_MPL_MINUS_HPP_INCLUDED 22 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/times.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_TIMES_HPP_INCLUDED 3 | #define BOOST_MPL_TIMES_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #define AUX778076_OP_NAME times 18 | #define AUX778076_OP_TOKEN * 19 | #include 20 | 21 | #endif // BOOST_MPL_TIMES_HPP_INCLUDED 22 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/range/iterator_range.hpp: -------------------------------------------------------------------------------- 1 | // Boost.Range library 2 | // 3 | // Copyright Neil Groves 2009. 4 | // Use, modification and distribution is subject to the Boost Software 5 | // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | // For more information, see http://www.boost.org/libs/range/ 9 | // 10 | #ifndef BOOST_RANGE_ITERATOR_RANGE_HPP_INCLUDED 11 | #define BOOST_RANGE_ITERATOR_RANGE_HPP_INCLUDED 12 | 13 | #include "boost/range/iterator_range_core.hpp" 14 | #include "boost/range/iterator_range_io.hpp" 15 | 16 | #endif // include guard 17 | -------------------------------------------------------------------------------- /thirdparty/dynet/dynet/timing.h: -------------------------------------------------------------------------------- 1 | #ifndef _TIMING_H_ 2 | #define _TIMING_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace dynet { 9 | 10 | struct Timer { 11 | Timer(const std::string& msg) : msg(msg), start(std::chrono::high_resolution_clock::now()) {} 12 | ~Timer() { 13 | auto stop = std::chrono::high_resolution_clock::now(); 14 | std::cerr << '[' << msg << ' ' << std::chrono::duration(stop-start).count() << " ms]\n"; 15 | } 16 | std::string msg; 17 | std::chrono::high_resolution_clock::time_point start; 18 | }; 19 | 20 | } // namespace dynet 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /thirdparty/eigen/unsupported/doc/examples/MatrixSine.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | MatrixXd A = MatrixXd::Random(3,3); 9 | std::cout << "A = \n" << A << "\n\n"; 10 | 11 | MatrixXd sinA = A.sin(); 12 | std::cout << "sin(A) = \n" << sinA << "\n\n"; 13 | 14 | MatrixXd cosA = A.cos(); 15 | std::cout << "cos(A) = \n" << cosA << "\n\n"; 16 | 17 | // The matrix functions satisfy sin^2(A) + cos^2(A) = I, 18 | // like the scalar functions. 19 | std::cout << "sin^2(A) + cos^2(A) = \n" << sinA*sinA + cosA*cosA << "\n\n"; 20 | } 21 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/aux_/config/intel.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_AUX_CONFIG_INTEL_HPP_INCLUDED 3 | #define BOOST_MPL_AUX_CONFIG_INTEL_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | 18 | // BOOST_INTEL_CXX_VERSION is defined here: 19 | #include 20 | 21 | #endif // BOOST_MPL_AUX_CONFIG_INTEL_HPP_INCLUDED 22 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/int.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_INT_HPP_INCLUDED 3 | #define BOOST_MPL_INT_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #include 18 | 19 | #define AUX_WRAPPER_VALUE_TYPE int 20 | #include 21 | 22 | #endif // BOOST_MPL_INT_HPP_INCLUDED 23 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/limits/list.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_LIMITS_LIST_HPP_INCLUDED 3 | #define BOOST_MPL_LIMITS_LIST_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #if !defined(BOOST_MPL_LIMIT_LIST_SIZE) 18 | # define BOOST_MPL_LIMIT_LIST_SIZE 20 19 | #endif 20 | 21 | #endif // BOOST_MPL_LIMITS_LIST_HPP_INCLUDED 22 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/greater.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_GREATER_HPP_INCLUDED 3 | #define BOOST_MPL_GREATER_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #define AUX778076_OP_NAME greater 18 | #define AUX778076_OP_TOKEN > 19 | #include 20 | 21 | #endif // BOOST_MPL_GREATER_HPP_INCLUDED 22 | -------------------------------------------------------------------------------- /src/srl/include/process/ModelTester.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/1/10. 3 | // 4 | 5 | #ifndef PROJECT_MODELTESTER_H 6 | #define PROJECT_MODELTESTER_H 7 | 8 | #include "AbstractPredictor.h" 9 | 10 | namespace model { 11 | template 12 | class ModelTester : public AbstractPredictor { 13 | public: 14 | ModelTester(TestConfigClass &config) : AbstractPredictor(config) {} 15 | 16 | virtual void init() { 17 | 18 | } 19 | 20 | virtual void predict() { 21 | 22 | } 23 | 24 | virtual void extractResult() { 25 | 26 | } 27 | }; 28 | 29 | } 30 | 31 | #endif //PROJECT_MODELTESTER_H 32 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/archive/detail/abi_suffix.hpp: -------------------------------------------------------------------------------- 1 | /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 2 | // abi_suffix.hpp 3 | 4 | // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . 5 | // Use, modification and distribution is subject to the Boost Software 6 | // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | 9 | // See http://www.boost.org for updates, documentation, and revision history. 10 | 11 | #ifdef BOOST_MSVC 12 | #pragma warning(pop) 13 | #endif 14 | #include // pops abi_suffix.hpp pragmas 15 | 16 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/config/platform/cloudabi.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Nuxi, https://nuxi.nl/ 2015. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | #define BOOST_PLATFORM "CloudABI" 7 | 8 | #define BOOST_HAS_DIRENT_H 9 | #define BOOST_HAS_STDINT_H 10 | #define BOOST_HAS_UNISTD_H 11 | 12 | #define BOOST_HAS_CLOCK_GETTIME 13 | #define BOOST_HAS_EXPM1 14 | #define BOOST_HAS_GETTIMEOFDAY 15 | #define BOOST_HAS_LOG1P 16 | #define BOOST_HAS_NANOSLEEP 17 | #define BOOST_HAS_PTHREADS 18 | #define BOOST_HAS_SCHED_YIELD 19 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/detail/iterator.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright David Abrahams 2002. 2 | // Distributed under the Boost Software License, Version 1.0. (See 3 | // accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | #ifndef ITERATOR_DWA122600_HPP_ 7 | #define ITERATOR_DWA122600_HPP_ 8 | 9 | // This header is obsolete and will be deprecated. 10 | 11 | #include 12 | 13 | namespace boost 14 | { 15 | 16 | namespace detail 17 | { 18 | 19 | using std::iterator_traits; 20 | using std::distance; 21 | 22 | } // namespace detail 23 | 24 | } // namespace boost 25 | 26 | #endif // ITERATOR_DWA122600_HPP_ 27 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/enable_shared_from_this.hpp: -------------------------------------------------------------------------------- 1 | #ifndef BOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED 2 | #define BOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED 3 | 4 | // 5 | // enable_shared_from_this.hpp 6 | // 7 | // Copyright (c) 2002 Peter Dimov 8 | // 9 | // Distributed under the Boost Software License, Version 1.0. 10 | // See accompanying file LICENSE_1_0.txt or copy at 11 | // http://www.boost.org/LICENSE_1_0.txt 12 | // 13 | // http://www.boost.org/libs/smart_ptr/enable_shared_from_this.html 14 | // 15 | 16 | #include 17 | 18 | #endif // #ifndef BOOST_ENABLE_SHARED_FROM_THIS_HPP_INCLUDED 19 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/function/detail/function_iterate.hpp: -------------------------------------------------------------------------------- 1 | // Boost.Function library 2 | 3 | // Copyright Douglas Gregor 2003. Use, modification and 4 | // distribution is subject to the Boost Software License, Version 5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | // For more information, see http://www.boost.org 9 | #if !defined(BOOST_PP_IS_ITERATING) 10 | # error Boost.Function - do not include this file! 11 | #endif 12 | 13 | #define BOOST_FUNCTION_NUM_ARGS BOOST_PP_ITERATION() 14 | #include 15 | #undef BOOST_FUNCTION_NUM_ARGS 16 | 17 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/equal_to.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_EQUAL_TO_HPP_INCLUDED 3 | #define BOOST_MPL_EQUAL_TO_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #define AUX778076_OP_NAME equal_to 18 | #define AUX778076_OP_TOKEN == 19 | #include 20 | 21 | #endif // BOOST_MPL_EQUAL_TO_HPP_INCLUDED 22 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/limits/vector.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_LIMITS_VECTOR_HPP_INCLUDED 3 | #define BOOST_MPL_LIMITS_VECTOR_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #if !defined(BOOST_MPL_LIMIT_VECTOR_SIZE) 18 | # define BOOST_MPL_LIMIT_VECTOR_SIZE 20 19 | #endif 20 | 21 | #endif // BOOST_MPL_LIMITS_VECTOR_HPP_INCLUDED 22 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/long.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_LONG_HPP_INCLUDED 3 | #define BOOST_MPL_LONG_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #include 18 | 19 | #define AUX_WRAPPER_VALUE_TYPE long 20 | #include 21 | 22 | #endif // BOOST_MPL_LONG_HPP_INCLUDED 23 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/shared_ptr.hpp: -------------------------------------------------------------------------------- 1 | #ifndef BOOST_SHARED_PTR_HPP_INCLUDED 2 | #define BOOST_SHARED_PTR_HPP_INCLUDED 3 | 4 | // 5 | // shared_ptr.hpp 6 | // 7 | // (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. 8 | // Copyright (c) 2001-2008 Peter Dimov 9 | // 10 | // Distributed under the Boost Software License, Version 1.0. (See 11 | // accompanying file LICENSE_1_0.txt or copy at 12 | // http://www.boost.org/LICENSE_1_0.txt) 13 | // 14 | // See http://www.boost.org/libs/smart_ptr/shared_ptr.htm for documentation. 15 | // 16 | 17 | #include 18 | 19 | #endif // #ifndef BOOST_SHARED_PTR_HPP_INCLUDED 20 | -------------------------------------------------------------------------------- /thirdparty/eigen/unsupported/doc/examples/MatrixSinh.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | 6 | int main() 7 | { 8 | MatrixXf A = MatrixXf::Random(3,3); 9 | std::cout << "A = \n" << A << "\n\n"; 10 | 11 | MatrixXf sinhA = A.sinh(); 12 | std::cout << "sinh(A) = \n" << sinhA << "\n\n"; 13 | 14 | MatrixXf coshA = A.cosh(); 15 | std::cout << "cosh(A) = \n" << coshA << "\n\n"; 16 | 17 | // The matrix functions satisfy cosh^2(A) - sinh^2(A) = I, 18 | // like the scalar functions. 19 | std::cout << "cosh^2(A) - sinh^2(A) = \n" << coshA*coshA - sinhA*sinhA << "\n\n"; 20 | } 21 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/aux_/config/use_preprocessed.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_AUX_CONFIG_USE_PREPROCESSED_HPP_INCLUDED 3 | #define BOOST_MPL_AUX_CONFIG_USE_PREPROCESSED_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | // #define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS 18 | 19 | #endif // BOOST_MPL_AUX_CONFIG_USE_PREPROCESSED_HPP_INCLUDED 20 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/random/detail/config.hpp: -------------------------------------------------------------------------------- 1 | /* boost random/detail/config.hpp header file 2 | * 3 | * Copyright Steven Watanabe 2009 4 | * Distributed under the Boost Software License, Version 1.0. (See 5 | * accompanying file LICENSE_1_0.txt or copy at 6 | * http://www.boost.org/LICENSE_1_0.txt) 7 | * 8 | * See http://www.boost.org for most recent version including documentation. 9 | * 10 | * $Id$ 11 | */ 12 | 13 | #include 14 | 15 | #if (defined(BOOST_NO_OPERATORS_IN_NAMESPACE) || defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)) \ 16 | && !defined(BOOST_MSVC) 17 | #define BOOST_RANDOM_NO_STREAM_OPERATORS 18 | #endif 19 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/less_equal.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_LESS_EQUAL_HPP_INCLUDED 3 | #define BOOST_MPL_LESS_EQUAL_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #define AUX778076_OP_NAME less_equal 18 | #define AUX778076_OP_TOKEN <= 19 | #include 20 | 21 | #endif // BOOST_MPL_LESS_EQUAL_HPP_INCLUDED 22 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/limits/arity.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_LIMITS_ARITY_HPP_INCLUDED 3 | #define BOOST_MPL_LIMITS_ARITY_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #if !defined(BOOST_MPL_LIMIT_METAFUNCTION_ARITY) 18 | # define BOOST_MPL_LIMIT_METAFUNCTION_ARITY 5 19 | #endif 20 | 21 | #endif // BOOST_MPL_LIMITS_ARITY_HPP_INCLUDED 22 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/limits/unrolling.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_LIMITS_UNROLLING_HPP_INCLUDED 3 | #define BOOST_MPL_LIMITS_UNROLLING_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #if !defined(BOOST_MPL_LIMIT_UNROLLING) 18 | # define BOOST_MPL_LIMIT_UNROLLING 4 19 | #endif 20 | 21 | #endif // BOOST_MPL_LIMITS_UNROLLING_HPP_INCLUDED 22 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/preprocessor/punctuation/comma.hpp: -------------------------------------------------------------------------------- 1 | # /* Copyright (C) 2001 2 | # * Housemarque Oy 3 | # * http://www.housemarque.com 4 | # * 5 | # * Distributed under the Boost Software License, Version 1.0. (See 6 | # * accompanying file LICENSE_1_0.txt or copy at 7 | # * http://www.boost.org/LICENSE_1_0.txt) 8 | # */ 9 | # 10 | # /* Revised by Paul Mensonides (2002) */ 11 | # 12 | # /* See http://www.boost.org for most recent version. */ 13 | # 14 | # ifndef BOOST_PREPROCESSOR_PUNCTUATION_COMMA_HPP 15 | # define BOOST_PREPROCESSOR_PUNCTUATION_COMMA_HPP 16 | # 17 | # /* BOOST_PP_COMMA */ 18 | # 19 | # define BOOST_PP_COMMA() , 20 | # 21 | # endif 22 | -------------------------------------------------------------------------------- /src/srl/include/process/ModelTrainer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/1/4. 3 | // 4 | 5 | #ifndef PROJECT_MODELTRAINER_H 6 | #define PROJECT_MODELTRAINER_H 7 | 8 | #include "../model/Model.h" 9 | #include "AbstractTrainer.h" 10 | 11 | namespace model { 12 | template 13 | class ModelTrainer : public AbstractTrainer { 14 | public: 15 | ModelTrainer(TrainConfigClass & config):AbstractTrainer(config) {} 16 | virtual void train() { 17 | 18 | }; 19 | 20 | virtual bool checkDev() { 21 | return false; 22 | } 23 | 24 | }; 25 | } 26 | 27 | 28 | 29 | #endif //PROJECT_MODELTRAINER_H 30 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/list/aux_/tag.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_LIST_AUX_TAG_HPP_INCLUDED 3 | #define BOOST_MPL_LIST_AUX_TAG_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | namespace boost { namespace mpl { namespace aux { 18 | 19 | struct list_tag; 20 | struct l_iter_tag; 21 | 22 | }}} 23 | 24 | #endif // BOOST_MPL_LIST_AUX_TAG_HPP_INCLUDED 25 | -------------------------------------------------------------------------------- /doc/index.rst: -------------------------------------------------------------------------------- 1 | .. ltpdoctest documentation master file, created by 2 | sphinx-quickstart on Wed Jan 14 22:35:55 2015. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | .. include:: intro.rst 7 | 8 | .. include:: news.rst 9 | 10 | 目录 11 | ===== 12 | 13 | .. toctree:: 14 | :maxdepth: 2 15 | 16 | begin 17 | install 18 | ltptest 19 | api 20 | ltpserver 21 | otherlanguage 22 | train 23 | theory 24 | faq 25 | paper 26 | appendix 27 | license 28 | 29 | 30 | 索引及表格 31 | ================== 32 | 33 | * :ref:`genindex` 34 | * :ref:`search` 35 | 36 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/chrono/clock_string.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // (C) Copyright 2010-2011 Vicente J. Botet Escriba 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | // 7 | 8 | #ifndef BOOST_CHRONO_CLOCK_STRING_HPP 9 | #define BOOST_CHRONO_CLOCK_STRING_HPP 10 | 11 | #include 12 | 13 | namespace boost 14 | { 15 | namespace chrono 16 | { 17 | 18 | template 19 | struct clock_string; 20 | 21 | } // chrono 22 | 23 | } // boost 24 | 25 | #endif // BOOST_CHRONO_CLOCK_STRING_HPP 26 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/not_equal_to.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_NOT_EQUAL_TO_HPP_INCLUDED 3 | #define BOOST_MPL_NOT_EQUAL_TO_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #define AUX778076_OP_NAME not_equal_to 18 | #define AUX778076_OP_TOKEN != 19 | #include 20 | 21 | #endif // BOOST_MPL_NOT_EQUAL_TO_HPP_INCLUDED 22 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/spirit/include/classic_chset.hpp: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | Copyright (c) 2001-2008 Joel de Guzman 3 | Copyright (c) 2001-2008 Hartmut Kaiser 4 | http://spirit.sourceforge.net/ 5 | 6 | Distributed under the Boost Software License, Version 1.0. (See accompanying 7 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 8 | =============================================================================*/ 9 | #ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_CHSET 10 | #define BOOST_SPIRIT_INCLUDE_CLASSIC_CHSET 11 | #include 12 | #endif 13 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/unordered/detail/fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (C) 2008-2011 Daniel James. 3 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 4 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | #ifndef BOOST_UNORDERED_FWD_HPP_INCLUDED 7 | #define BOOST_UNORDERED_FWD_HPP_INCLUDED 8 | 9 | #include 10 | #if defined(BOOST_HAS_PRAGMA_ONCE) 11 | #pragma once 12 | #endif 13 | 14 | namespace boost 15 | { 16 | namespace unordered 17 | { 18 | struct piecewise_construct_t {}; 19 | const piecewise_construct_t piecewise_construct = piecewise_construct_t(); 20 | } 21 | } 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/greater_equal.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_GREATER_EQUAL_HPP_INCLUDED 3 | #define BOOST_MPL_GREATER_EQUAL_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #define AUX778076_OP_NAME greater_equal 18 | #define AUX778076_OP_TOKEN >= 19 | #include 20 | 21 | #endif // BOOST_MPL_GREATER_EQUAL_HPP_INCLUDED 22 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/spirit/include/classic_rule.hpp: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | Copyright (c) 2001-2008 Joel de Guzman 3 | Copyright (c) 2001-2008 Hartmut Kaiser 4 | http://spirit.sourceforge.net/ 5 | 6 | Distributed under the Boost Software License, Version 1.0. (See accompanying 7 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 8 | =============================================================================*/ 9 | #ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_RULE 10 | #define BOOST_SPIRIT_INCLUDE_CLASSIC_RULE 11 | #include 12 | #endif 13 | -------------------------------------------------------------------------------- /src/srl/include/extractor/AbstractConverter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/1/3. 3 | // 4 | 5 | #ifndef PROJECT_ABSTRUCTCONVERTER_H 6 | #define PROJECT_ABSTRUCTCONVERTER_H 7 | 8 | #include "string" 9 | using namespace std; 10 | 11 | namespace extractor { 12 | template 13 | class AbstractConverter{ 14 | virtual void init(T1 & origin_data_ref) = 0; 15 | virtual void run() = 0; 16 | virtual T2 & getResult() = 0; 17 | virtual void clear() {}; 18 | 19 | static string getClassName() { 20 | return "Converter<" + T1::getClassName() + ", " + T2::getClassName() + ">"; 21 | } 22 | }; 23 | } 24 | 25 | #endif //PROJECT_ABSTRUCTCONVERTER_H 26 | -------------------------------------------------------------------------------- /src/srl/include/process/AbstractTrainer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/1/5. 3 | // 4 | 5 | #ifndef PROJECT_ABSTRACTTRAINER_H 6 | #define PROJECT_ABSTRACTTRAINER_H 7 | 8 | #include "../base/process.h" 9 | namespace model { 10 | template 11 | class AbstractTrainer : public base::Process { 12 | public: 13 | AbstractTrainer(TrainConfigClass & config):base::Process(config) {} 14 | 15 | virtual void main() { 16 | this->init(); 17 | this->train(); 18 | } 19 | 20 | virtual void train() = 0; 21 | virtual void init() {}; 22 | }; 23 | } 24 | 25 | 26 | 27 | #endif //PROJECT_ABSTRACTTRAINER_H 28 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/interprocess/detail/config_end.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost 4 | // Software License, Version 1.0. (See accompanying file 5 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // See http://www.boost.org/libs/interprocess for documentation. 8 | // 9 | ////////////////////////////////////////////////////////////////////////////// 10 | #if defined BOOST_MSVC 11 | #pragma warning (pop) 12 | #endif 13 | 14 | #if defined(BOOST_GCC) && (BOOST_GCC >= 40600) 15 | #pragma GCC diagnostic pop 16 | #endif 17 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/at_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_AT_FWD_HPP_INCLUDED 3 | #define BOOST_MPL_AT_FWD_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | namespace boost { namespace mpl { 18 | 19 | template< typename Tag > struct at_impl; 20 | template< typename Sequence, typename N > struct at; 21 | 22 | }} 23 | 24 | #endif // BOOST_MPL_AT_FWD_HPP_INCLUDED 25 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/back_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_BACK_FWD_HPP_INCLUDED 3 | #define BOOST_MPL_BACK_FWD_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | namespace boost { namespace mpl { 18 | 19 | template< typename Tag > struct back_impl; 20 | template< typename Sequence > struct back; 21 | 22 | }} 23 | 24 | #endif // BOOST_MPL_BACK_FWD_HPP_INCLUDED 25 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/size_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_SIZE_FWD_HPP_INCLUDED 3 | #define BOOST_MPL_SIZE_FWD_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | namespace boost { namespace mpl { 18 | 19 | template< typename Tag > struct size_impl; 20 | template< typename Sequence > struct size; 21 | 22 | }} 23 | 24 | #endif // BOOST_MPL_SIZE_FWD_HPP_INCLUDED 25 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/predef/library/c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2008-2015 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #if !defined(BOOST_PREDEF_LIBRARY_C_H) || defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS) 9 | #ifndef BOOST_PREDEF_LIBRARY_C_H 10 | #define BOOST_PREDEF_LIBRARY_C_H 11 | #endif 12 | 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/unordered_map.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (C) 2003-2004 Jeremy B. Maitin-Shepard. 3 | // Copyright (C) 2005-2008 Daniel James. 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | 7 | // See http://www.boost.org/libs/unordered for documentation 8 | 9 | #ifndef BOOST_UNORDERED_MAP_HPP_INCLUDED 10 | #define BOOST_UNORDERED_MAP_HPP_INCLUDED 11 | 12 | #include 13 | #if defined(BOOST_HAS_PRAGMA_ONCE) 14 | #pragma once 15 | #endif 16 | 17 | #include 18 | 19 | #endif // BOOST_UNORDERED_MAP_HPP_INCLUDED 20 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/unordered_set.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (C) 2003-2004 Jeremy B. Maitin-Shepard. 3 | // Copyright (C) 2005-2008 Daniel James. 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | 7 | // See http://www.boost.org/libs/unordered for documentation 8 | 9 | #ifndef BOOST_UNORDERED_SET_HPP_INCLUDED 10 | #define BOOST_UNORDERED_SET_HPP_INCLUDED 11 | 12 | #include 13 | #if defined(BOOST_HAS_PRAGMA_ONCE) 14 | #pragma once 15 | #endif 16 | 17 | #include 18 | 19 | #endif // BOOST_UNORDERED_SET_HPP_INCLUDED 20 | -------------------------------------------------------------------------------- /src/segmentor/partial_segmentation.h: -------------------------------------------------------------------------------- 1 | #ifndef __LTP_PARTIAL_SEGMENTATION_H__ 2 | #define __LTP_PARTIAL_SEGMENTATION_H__ 3 | 4 | #include 5 | #include 6 | 7 | namespace ltp { 8 | namespace segmentor { 9 | 10 | class PartialSegmentationUtils { 11 | public: 12 | static int split_by_partial_tag(const std::string& line, 13 | std::vector& words); 14 | 15 | static bool is_partial_tagged_word(const std::string& word); 16 | 17 | static void trim_partial_tag(const std::string& input, 18 | std::string& output); 19 | }; 20 | 21 | } // end namespace segmentor 22 | } // end namespace ltp 23 | 24 | #endif // end for __LTP_PARTIAL_SEGMENTATION_H__ 25 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/concept/detail/backward_compatibility.hpp: -------------------------------------------------------------------------------- 1 | // Copyright David Abrahams 2009. Distributed under the Boost 2 | // Software License, Version 1.0. (See accompanying 3 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 4 | #ifndef BOOST_CONCEPT_BACKWARD_COMPATIBILITY_DWA200968_HPP 5 | # define BOOST_CONCEPT_BACKWARD_COMPATIBILITY_DWA200968_HPP 6 | 7 | namespace boost 8 | { 9 | namespace concepts {} 10 | 11 | # if defined(BOOST_HAS_CONCEPTS) && !defined(BOOST_CONCEPT_NO_BACKWARD_KEYWORD) 12 | namespace concept = concepts; 13 | # endif 14 | } // namespace boost::concept 15 | 16 | #endif // BOOST_CONCEPT_BACKWARD_COMPATIBILITY_DWA200968_HPP 17 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/clear_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_CLEAR_FWD_HPP_INCLUDED 3 | #define BOOST_MPL_CLEAR_FWD_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | namespace boost { namespace mpl { 18 | 19 | template< typename Tag > struct clear_impl; 20 | template< typename Sequence > struct clear; 21 | 22 | }} 23 | 24 | #endif // BOOST_MPL_CLEAR_FWD_HPP_INCLUDED 25 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/empty_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_EMPTY_FWD_HPP_INCLUDED 3 | #define BOOST_MPL_EMPTY_FWD_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | namespace boost { namespace mpl { 18 | 19 | template< typename Tag > struct empty_impl; 20 | template< typename Sequence > struct empty; 21 | 22 | }} 23 | 24 | #endif // BOOST_MPL_EMPTY_FWD_HPP_INCLUDED 25 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/front_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_FRONT_FWD_HPP_INCLUDED 3 | #define BOOST_MPL_FRONT_FWD_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | namespace boost { namespace mpl { 18 | 19 | template< typename Tag > struct front_impl; 20 | template< typename Sequence > struct front; 21 | 22 | }} 23 | 24 | #endif // BOOST_MPL_FRONT_FWD_HPP_INCLUDED 25 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/aux_/has_size.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_AUX_HAS_SIZE_HPP_INCLUDED 3 | #define BOOST_MPL_AUX_HAS_SIZE_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2002-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #include 18 | 19 | namespace boost { namespace mpl { namespace aux { 20 | BOOST_MPL_HAS_XXX_TRAIT_DEF(size) 21 | }}} 22 | 23 | #endif // BOOST_MPL_AUX_HAS_SIZE_HPP_INCLUDED 24 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/spirit/include/classic_numerics.hpp: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | Copyright (c) 2001-2008 Joel de Guzman 3 | Copyright (c) 2001-2008 Hartmut Kaiser 4 | http://spirit.sourceforge.net/ 5 | 6 | Distributed under the Boost Software License, Version 1.0. (See accompanying 7 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 8 | =============================================================================*/ 9 | #ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_NUMERICS 10 | #define BOOST_SPIRIT_INCLUDE_CLASSIC_NUMERICS 11 | #include 12 | #endif 13 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/spirit/include/classic_operators.hpp: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | Copyright (c) 2001-2008 Joel de Guzman 3 | Copyright (c) 2001-2008 Hartmut Kaiser 4 | http://spirit.sourceforge.net/ 5 | 6 | Distributed under the Boost Software License, Version 1.0. (See accompanying 7 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 8 | =============================================================================*/ 9 | #ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_OPERATORS 10 | #define BOOST_SPIRIT_INCLUDE_CLASSIC_OPERATORS 11 | #include 12 | #endif 13 | -------------------------------------------------------------------------------- /thirdparty/dynet/dynet/gpu-ops.h: -------------------------------------------------------------------------------- 1 | #ifndef DYNET_GPU_OPS_H 2 | #define DYNET_GPU_OPS_H 3 | 4 | namespace dynet { 5 | namespace gpu { 6 | 7 | void dense_to_sparse_assign(int n, const unsigned int* ids, float* src, float* trg); 8 | void sparse_to_dense_assign(int n, const unsigned int* ids, float* src, float* trg); 9 | void dense_to_sparse_subtract(int n, const unsigned int* ids, float* src, float* trg); 10 | void sparse_to_dense_block_assign_and_multiply(int n, const unsigned *idx, int bsize, float mult, float *src, float *trg); 11 | void dense_to_sparse_block_add(int n, const unsigned* ids, int bsize, float* src, float* trg); 12 | 13 | } // namespace gpu 14 | } // namespace dynet 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /thirdparty/dynet/dynet/saxe-init.cc: -------------------------------------------------------------------------------- 1 | #include "dynet/saxe-init.h" 2 | #include "dynet/tensor.h" 3 | #include "dynet/globals.h" 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | using namespace std; 11 | 12 | namespace dynet { 13 | 14 | void orthonormal_random(unsigned dd, float g, Tensor& x) { 15 | Tensor t; 16 | t.d = Dim({dd, dd}); 17 | t.v = new float[dd * dd]; 18 | normal_distribution distribution(0, 0.01); 19 | auto b = [&] () {return distribution(*rndeng);}; 20 | generate(t.v, t.v + dd*dd, b); 21 | Eigen::JacobiSVD svd(*t, Eigen::ComputeFullU); 22 | *x = svd.matrixU(); 23 | delete[] t.v; 24 | } 25 | 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/srl/include/process/ModelPredictor.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/1/4. 3 | // 4 | 5 | #ifndef PROJECT_MODELPREDICTOR_H 6 | #define PROJECT_MODELPREDICTOR_H 7 | 8 | #include "process/AbstractPredictor.h" 9 | namespace model { 10 | template 11 | class ModelPredictor : public AbstractPredictor{ 12 | public: 13 | ModelPredictor(TestConfigClass &config) : AbstractPredictor(config) {} 14 | 15 | virtual void init() { 16 | 17 | } 18 | 19 | virtual void predict() { 20 | 21 | } 22 | 23 | virtual void extractResult() { 24 | 25 | } 26 | 27 | }; 28 | } 29 | 30 | 31 | 32 | #endif //PROJECT_MODELPREDICTOR_H 33 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/random/detail/enable_warnings.hpp: -------------------------------------------------------------------------------- 1 | /* boost random/detail/enable_warnings.hpp header file 2 | * 3 | * Copyright Steven Watanabe 2009 4 | * Distributed under the Boost Software License, Version 1.0. (See 5 | * accompanying file LICENSE_1_0.txt or copy at 6 | * http://www.boost.org/LICENSE_1_0.txt) 7 | * 8 | * See http://www.boost.org for most recent version including documentation. 9 | * 10 | * $Id$ 11 | * 12 | */ 13 | 14 | // No #include guard. This header is intended to be included multiple times. 15 | 16 | #ifdef BOOST_MSVC 17 | #pragma warning(pop) 18 | #endif 19 | 20 | #if defined(BOOST_GCC) && BOOST_GCC >= 40600 21 | #pragma GCC diagnostic pop 22 | #endif 23 | -------------------------------------------------------------------------------- /thirdparty/boost/libs/program_options/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRECTORIES( ./ 2 | ${THIRDPARTY_DIR}/boost/include/ ) 3 | 4 | set (boost_program_options_VERSION "1.61") 5 | 6 | FILE(GLOB boost_program_options_SRC src/*.cpp) 7 | 8 | add_library(boost_program_options_static_lib STATIC ${boost_program_options_SRC}) 9 | add_library(boost_program_options_shared_lib SHARED ${boost_program_options_SRC}) 10 | set_target_properties (boost_program_options_static_lib PROPERTIES 11 | OUTPUT_NAME boost_program_options 12 | PREFIX "lib") 13 | set_target_properties (boost_program_options_shared_lib PROPERTIES 14 | VERSION ${boost_program_options_VERSION} 15 | OUTPUT_NAME boost_program_options) 16 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/move/detail/std_ns_end.hpp: -------------------------------------------------------------------------------- 1 | #////////////////////////////////////////////////////////////////////////////// 2 | #// 3 | #// (C) Copyright Ion Gaztanaga 2015-2015. 4 | #// Distributed under the Boost Software License, Version 1.0. 5 | #// (See accompanying file LICENSE_1_0.txt or copy at 6 | #// http://www.boost.org/LICENSE_1_0.txt) 7 | #// 8 | #// See http://www.boost.org/libs/move for documentation. 9 | #// 10 | #////////////////////////////////////////////////////////////////////////////// 11 | #ifdef BOOST_MOVE_STD_NS_GCC_DIAGNOSTIC_PUSH 12 | #pragma GCC diagnostic pop 13 | #undef BOOST_MOVE_STD_NS_GCC_DIAGNOSTIC_PUSH 14 | #endif //BOOST_MOVE_STD_NS_GCC_DIAGNOSTIC_PUSH 15 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/O1_size_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_O1_SIZE_FWD_HPP_INCLUDED 3 | #define BOOST_MPL_O1_SIZE_FWD_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | namespace boost { namespace mpl { 18 | 19 | template< typename Tag > struct O1_size_impl; 20 | template< typename Sequence > struct O1_size; 21 | 22 | }} 23 | 24 | #endif // BOOST_MPL_O1_SIZE_FWD_HPP_INCLUDED 25 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/spirit/include/classic_actions.hpp: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | Copyright (c) 2001-2008 Joel de Guzman 3 | Copyright (c) 2001-2008 Hartmut Kaiser 4 | http://spirit.sourceforge.net/ 5 | 6 | Distributed under the Boost Software License, Version 1.0. (See accompanying 7 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 8 | =============================================================================*/ 9 | #ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_CLASSIC_ACTIONS 10 | #define BOOST_SPIRIT_INCLUDE_CLASSIC_CLASSIC_ACTIONS 11 | #include 12 | #endif 13 | -------------------------------------------------------------------------------- /src/srl/common/model/ConstLookupModelBuilder.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/3/9. 3 | // 4 | 5 | #ifndef PROJECT_CONSTLOOKUPMODELBUILDER_H 6 | #define PROJECT_CONSTLOOKUPMODELBUILDER_H 7 | 8 | #include "LookupModelBuilder.h" 9 | #include 10 | 11 | class ConstLookupModelBuilder: public LookupModelBuilder { 12 | public: 13 | ConstLookupModelBuilder(unsigned inputDim = 0, unsigned expressionDim = 0): 14 | LookupModelBuilder(inputDim, expressionDim) { } 15 | 16 | virtual Expression forward(ComputationGraph &hg, const unsigned & num) { 17 | return dynet::expr::const_lookup(hg, lookupParameter, num); 18 | } 19 | 20 | }; 21 | 22 | 23 | #endif //PROJECT_CONSTLOOKUPMODELBUILDER_H 24 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/archive/detail/abi_prefix.hpp: -------------------------------------------------------------------------------- 1 | /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 2 | // abi_prefix.hpp 3 | 4 | // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . 5 | // Use, modification and distribution is subject to the Boost Software 6 | // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | 9 | // See http://www.boost.org for updates, documentation, and revision history. 10 | 11 | #include // must be the last header 12 | #ifdef BOOST_MSVC 13 | # pragma warning(push) 14 | # pragma warning(disable : 4251 4231 4660 4275) 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/aux_/has_tag.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_AUX_HAS_TAG_HPP_INCLUDED 3 | #define BOOST_MPL_AUX_HAS_TAG_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2002-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #include 18 | 19 | namespace boost { namespace mpl { namespace aux { 20 | BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_tag, tag, false) 21 | }}} 22 | 23 | #endif // BOOST_MPL_AUX_HAS_TAG_HPP_INCLUDED 24 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/pop_back_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_POP_BACK_FWD_HPP_INCLUDED 3 | #define BOOST_MPL_POP_BACK_FWD_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | namespace boost { namespace mpl { 18 | 19 | template< typename Tag > struct pop_back_impl; 20 | template< typename Sequence > struct pop_back; 21 | 22 | }} 23 | 24 | #endif // BOOST_MPL_POP_BACK_FWD_HPP_INCLUDED 25 | -------------------------------------------------------------------------------- /thirdparty/boost/libs/serialization/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | INCLUDE_DIRECTORIES( ./ 2 | ${THIRDPARTY_DIR}/boost/include/ ) 3 | 4 | set (boost_serialization_VERSION "1.61") 5 | 6 | FILE(GLOB boost_serialization_SRC src/*.cpp src/*.ipp) 7 | 8 | add_library (boost_serialization_static_lib STATIC ${boost_serialization_SRC}) 9 | 10 | set_target_properties (boost_serialization_static_lib PROPERTIES 11 | OUTPUT_NAME boost_serialization 12 | PREFIX "lib") 13 | 14 | add_library (boost_serialization_shared_lib SHARED ${boost_serialization_SRC}) 15 | 16 | set_target_properties (boost_serialization_shared_lib PROPERTIES 17 | VERSION ${boost_serialization_VERSION} 18 | OUTPUT_NAME boost_serialization) 19 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/aux_/has_type.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_AUX_HAS_TYPE_HPP_INCLUDED 3 | #define BOOST_MPL_AUX_HAS_TYPE_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2002-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #include 18 | 19 | namespace boost { namespace mpl { namespace aux { 20 | BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_type, type, true) 21 | }}} 22 | 23 | #endif // BOOST_MPL_AUX_HAS_TYPE_HPP_INCLUDED 24 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/aux_/template_arity_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_AUX_TEMPLATE_ARITY_FWD_HPP_INCLUDED 3 | #define BOOST_MPL_AUX_TEMPLATE_ARITY_FWD_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2001-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | namespace boost { namespace mpl { namespace aux { 18 | 19 | template< typename F > struct template_arity; 20 | 21 | }}} 22 | 23 | #endif // BOOST_MPL_AUX_TEMPLATE_ARITY_FWD_HPP_INCLUDED 24 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/pop_front_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_POP_FRONT_FWD_HPP_INCLUDED 3 | #define BOOST_MPL_POP_FRONT_FWD_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | namespace boost { namespace mpl { 18 | 19 | template< typename Tag > struct pop_front_impl; 20 | template< typename Sequence > struct pop_front; 21 | 22 | }} 23 | 24 | #endif // BOOST_MPL_POP_FRONT_FWD_HPP_INCLUDED 25 | -------------------------------------------------------------------------------- /src/utils/math/featurevec.h: -------------------------------------------------------------------------------- 1 | #ifndef __LTP_FEATURE_VECTOR_H__ 2 | #define __LTP_FEATURE_VECTOR_H__ 3 | 4 | namespace ltp { 5 | namespace math { 6 | 7 | struct FeatureVector { 8 | public: 9 | FeatureVector () : n(0), idx(0), val(0), loff(0) { 10 | } 11 | 12 | ~FeatureVector() { 13 | } 14 | 15 | void clear() { 16 | if (idx) { 17 | delete [](idx); 18 | idx = 0; 19 | } 20 | 21 | if (val) { 22 | delete [](val); 23 | val = 0; 24 | } 25 | } 26 | 27 | public: 28 | size_t n; 29 | int* idx; 30 | double* val; 31 | size_t loff; 32 | }; 33 | 34 | } // end for namespace math 35 | } // end for namespace ltp 36 | 37 | #endif // end for __LTP_FEATRUE_VECTOR_H__ 38 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/preprocessor/facilities/empty.hpp: -------------------------------------------------------------------------------- 1 | # /* Copyright (C) 2001 2 | # * Housemarque Oy 3 | # * http://www.housemarque.com 4 | # * 5 | # * Distributed under the Boost Software License, Version 1.0. (See 6 | # * accompanying file LICENSE_1_0.txt or copy at 7 | # * http://www.boost.org/LICENSE_1_0.txt) 8 | # */ 9 | # 10 | # /* Revised by Paul Mensonides (2002) */ 11 | # 12 | # /* See http://www.boost.org for most recent version. */ 13 | # 14 | # ifndef BOOST_PREPROCESSOR_FACILITIES_EMPTY_HPP 15 | # define BOOST_PREPROCESSOR_FACILITIES_EMPTY_HPP 16 | # 17 | # include 18 | # 19 | # /* BOOST_PP_EMPTY */ 20 | # 21 | # define BOOST_PP_EMPTY() 22 | # 23 | # endif 24 | -------------------------------------------------------------------------------- /src/srl/include/model/LoopCounter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/1/5. 3 | // 4 | 5 | #ifndef PROJECT_LOOPCOUNTER_H 6 | #define PROJECT_LOOPCOUNTER_H 7 | 8 | namespace model { 9 | class LoopCounter { 10 | unsigned counter = 0; 11 | public: 12 | unsigned size; 13 | LoopCounter(unsigned size): size(0) {} 14 | 15 | /** 16 | * +=1 17 | * @return if overflow 18 | */ 19 | inline bool update() { 20 | counter += 1; 21 | if (counter == size) { 22 | counter = 0; 23 | return true; 24 | } 25 | return false; 26 | } 27 | 28 | inline unsigned getCounter() { 29 | return counter; 30 | } 31 | }; 32 | } 33 | 34 | #endif //PROJECT_LOOPCOUNTER_H 35 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/aux_/has_begin.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_AUX_HAS_BEGIN_HPP_INCLUDED 3 | #define BOOST_MPL_AUX_HAS_BEGIN_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2002-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #include 18 | 19 | namespace boost { namespace mpl { namespace aux { 20 | BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_begin, begin, true) 21 | }}} 22 | 23 | #endif // BOOST_MPL_AUX_HAS_BEGIN_HPP_INCLUDED 24 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/ratio/mpl/rational_c_tag.hpp: -------------------------------------------------------------------------------- 1 | // abs.hpp 2 | // 3 | // (C) Copyright 2011 Vicente J. Botet Escriba 4 | // Use, modification and distribution are subject to the Boost Software License, 5 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt). 7 | // 8 | 9 | #ifndef BOOST_RATIO_MPL_RATIONAL_C_TAG_HPP 10 | #define BOOST_RATIO_MPL_RATIONAL_C_TAG_HPP 11 | 12 | #ifdef BOOST_RATIO_EXTENSIONS 13 | 14 | #include 15 | 16 | namespace boost { 17 | namespace mpl { 18 | 19 | struct rational_c_tag : int_<10> {}; 20 | 21 | } 22 | } 23 | 24 | #endif // BOOST_RATIO_EXTENSIONS 25 | #endif // BOOST_RATIO_MPL_RATIONAL_C_TAG_HPP 26 | -------------------------------------------------------------------------------- /thirdparty/dynet/dynet/dim.cc: -------------------------------------------------------------------------------- 1 | #include "dynet/dim.h" 2 | 3 | #include 4 | 5 | using namespace std; 6 | 7 | namespace dynet { 8 | 9 | ostream& operator<<(ostream& os, const Dim& d) { 10 | os << '{'; 11 | for (unsigned i = 0; i < d.nd; ++i) { 12 | if (i) os << ','; 13 | os << d.d[i]; 14 | } 15 | if(d.bd != 1) os << 'X' << d.bd; 16 | return os << '}'; 17 | } 18 | 19 | ostream& operator<<(ostream& os, const vector& ds) { 20 | os << '['; 21 | for (unsigned i = 0; i < ds.size(); ++i) 22 | os << (i ? " " : "") << ds[i]; 23 | return os << ']'; 24 | } 25 | 26 | DYNET_SERIALIZE_COMMIT(Dim, DYNET_SERIALIZE_DEFINE(nd, d)) 27 | DYNET_SERIALIZE_IMPL(Dim) 28 | 29 | } // namespace dynet 30 | 31 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/align/detail/is_alignment.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | (c) 2014 Glen Joseph Fernandes 3 | 4 | 5 | Distributed under the Boost Software 6 | License, Version 1.0. 7 | http://boost.org/LICENSE_1_0.txt 8 | */ 9 | #ifndef BOOST_ALIGN_DETAIL_IS_ALIGNMENT_HPP 10 | #define BOOST_ALIGN_DETAIL_IS_ALIGNMENT_HPP 11 | 12 | #include 13 | #include 14 | 15 | namespace boost { 16 | namespace alignment { 17 | namespace detail { 18 | 19 | BOOST_CONSTEXPR inline bool is_alignment(std::size_t value) 20 | BOOST_NOEXCEPT 21 | { 22 | return (value > 0) && ((value & (value - 1)) == 0); 23 | } 24 | 25 | } /* .detail */ 26 | } /* .alignment */ 27 | } /* .boost */ 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mem_fn.hpp: -------------------------------------------------------------------------------- 1 | #ifndef BOOST_MEM_FN_HPP_INCLUDED 2 | #define BOOST_MEM_FN_HPP_INCLUDED 3 | 4 | // MS compatible compilers support #pragma once 5 | 6 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 7 | # pragma once 8 | #endif 9 | 10 | // 11 | // mem_fn.hpp - a generalization of std::mem_fun[_ref] 12 | // 13 | // Copyright (c) 2009 Peter Dimov 14 | // 15 | // Distributed under the Boost Software License, Version 1.0. 16 | // See accompanying file LICENSE_1_0.txt or copy at 17 | // http://www.boost.org/LICENSE_1_0.txt 18 | // 19 | // See http://www.boost.org/libs/bind/mem_fn.html for documentation. 20 | // 21 | 22 | #include 23 | 24 | #endif // #ifndef BOOST_MEM_FN_HPP_INCLUDED 25 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/push_back_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_PUSH_BACK_FWD_HPP_INCLUDED 3 | #define BOOST_MPL_PUSH_BACK_FWD_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | namespace boost { namespace mpl { 18 | 19 | template< typename Tag > struct push_back_impl; 20 | template< typename Sequence, typename T > struct push_back; 21 | 22 | }} 23 | 24 | #endif // BOOST_MPL_PUSH_BACK_FWD_HPP_INCLUDED 25 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/aux_/config/gcc.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_AUX_CONFIG_GCC_HPP_INCLUDED 3 | #define BOOST_MPL_AUX_CONFIG_GCC_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #if defined(__GNUC__) && !defined(__EDG_VERSION__) 18 | # define BOOST_MPL_CFG_GCC ((__GNUC__ << 8) | __GNUC_MINOR__) 19 | #else 20 | # define BOOST_MPL_CFG_GCC 0 21 | #endif 22 | 23 | #endif // BOOST_MPL_AUX_CONFIG_GCC_HPP_INCLUDED 24 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/push_front_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_PUSH_FRONT_FWD_HPP_INCLUDED 3 | #define BOOST_MPL_PUSH_FRONT_FWD_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | namespace boost { namespace mpl { 18 | 19 | template< typename Tag > struct push_front_impl; 20 | template< typename Sequence, typename T > struct push_front; 21 | 22 | }} 23 | 24 | #endif // BOOST_MPL_PUSH_FRONT_FWD_HPP_INCLUDED 25 | -------------------------------------------------------------------------------- /thirdparty/eigen/unsupported/Eigen/MoreVectorization: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla 6 | // Public License v. 2.0. If a copy of the MPL was not distributed 7 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | #ifndef EIGEN_MOREVECTORIZATION_MODULE_H 10 | #define EIGEN_MOREVECTORIZATION_MODULE_H 11 | 12 | #include 13 | 14 | namespace Eigen { 15 | 16 | /** 17 | * \defgroup MoreVectorization More vectorization module 18 | */ 19 | 20 | } 21 | 22 | #include "src/MoreVectorization/MathFunctions.h" 23 | 24 | #endif // EIGEN_MOREVECTORIZATION_MODULE_H 25 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | MAINTAINER Michael Liu 3 | RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \ 4 | ca-certificates \ 5 | cmake \ 6 | curl \ 7 | g++ \ 8 | git \ 9 | make \ 10 | unzip \ 11 | && apt-get clean -y \ 12 | && rm -rf /var/lib/apt/lists/* 13 | 14 | RUN git clone https://github.com/HIT-SCIR/ltp.git ltp \ 15 | && cd ltp && ./configure && make -j "$(nproc)" \ 16 | && mv bin/ltp_server / && mv lib/libdynet.so /usr/lib/ && cd / && rm -fr ltp 17 | 18 | RUN curl --silent -o ltp_data.zip http://ospm9rsnd.bkt.clouddn.com/model/ltp_data_v3.4.0.zip \ 19 | && unzip ltp_data.zip && mv ltp_data_v3.4.0 ltp_data && rm -f ltp_data.zip 20 | 21 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/program_options/version.hpp: -------------------------------------------------------------------------------- 1 | // Copyright Vladimir Prus 2004. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt 4 | // or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | #ifndef BOOST_PROGRAM_OPTIONS_VERSION_HPP_VP_2004_04_05 7 | #define BOOST_PROGRAM_OPTIONS_VERSION_HPP_VP_2004_04_05 8 | 9 | /** The version of the source interface. 10 | The value will be incremented whenever a change is made which might 11 | cause compilation errors for existing code. 12 | */ 13 | #ifdef BOOST_PROGRAM_OPTIONS_VERSION 14 | #error BOOST_PROGRAM_OPTIONS_VERSION already defined 15 | #endif 16 | #define BOOST_PROGRAM_OPTIONS_VERSION 2 17 | 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/blank_fwd.hpp: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // boost blank_fwd.hpp header file 3 | // See http://www.boost.org for updates, documentation, and revision history. 4 | //----------------------------------------------------------------------------- 5 | // 6 | // Copyright (c) 2003 7 | // Eric Friedman 8 | // 9 | // Distributed under the Boost Software License, Version 1.0. (See 10 | // accompanying file LICENSE_1_0.txt or copy at 11 | // http://www.boost.org/LICENSE_1_0.txt) 12 | 13 | #ifndef BOOST_BLANK_FWD_HPP 14 | #define BOOST_BLANK_FWD_HPP 15 | 16 | namespace boost { 17 | 18 | struct blank; 19 | 20 | } // namespace boost 21 | 22 | #endif // BOOST_BLANK_FWD_HPP 23 | -------------------------------------------------------------------------------- /src/srl/include/process/AbstractPredictor.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/1/7. 3 | // 4 | 5 | #ifndef PROJECT_ABSTRACTPREDICTOR_H 6 | #define PROJECT_ABSTRACTPREDICTOR_H 7 | 8 | #include "../base/process.h" 9 | namespace model { 10 | template 11 | class AbstractPredictor : public base::Process{ 12 | public: 13 | AbstractPredictor(TestConfigClass &config) : base::Process(config) {} 14 | 15 | virtual void main() { 16 | init(); 17 | predict(); 18 | extractResult(); 19 | } 20 | virtual void init() = 0; 21 | virtual void predict() = 0; 22 | virtual void extractResult() = 0; 23 | 24 | }; 25 | } 26 | 27 | 28 | #endif //PROJECT_ABSTRACTPREDICTOR_H 29 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/detail/atomic_count.hpp: -------------------------------------------------------------------------------- 1 | #ifndef BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED 2 | #define BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED 3 | 4 | // MS compatible compilers support #pragma once 5 | 6 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 7 | # pragma once 8 | #endif 9 | 10 | // 11 | // boost/detail/atomic_count.hpp - thread/SMP safe reference counter 12 | // 13 | // Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. 14 | // 15 | // Distributed under the Boost Software License, Version 1.0. 16 | // See accompanying file LICENSE_1_0.txt or copy at 17 | // http://www.boost.org/LICENSE_1_0.txt 18 | 19 | #include 20 | 21 | #endif // #ifndef BOOST_DETAIL_ATOMIC_COUNT_HPP_INCLUDED 22 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/sequence_tag_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_SEQUENCE_TAG_FWD_HPP_INCLUDED 3 | #define BOOST_MPL_SEQUENCE_TAG_FWD_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | namespace boost { namespace mpl { 18 | 19 | struct nested_begin_end_tag; 20 | struct non_sequence_tag; 21 | 22 | template< typename Sequence > struct sequence_tag; 23 | 24 | }} 25 | 26 | #endif // BOOST_MPL_SEQUENCE_TAG_FWD_HPP_INCLUDED 27 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/void_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_VOID_FWD_HPP_INCLUDED 3 | #define BOOST_MPL_VOID_FWD_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2001-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #include 18 | 19 | BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN 20 | 21 | struct void_; 22 | 23 | BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE 24 | BOOST_MPL_AUX_ADL_BARRIER_DECL(void_) 25 | 26 | #endif // BOOST_MPL_VOID_FWD_HPP_INCLUDED 27 | -------------------------------------------------------------------------------- /thirdparty/boost/libs/program_options/src/utf8_codecvt_facet.cpp: -------------------------------------------------------------------------------- 1 | // Copyright Vladimir Prus 2004. 2 | // Distributed under the Boost Software License, Version 1.0. 3 | // (See accompanying file LICENSE_1_0.txt 4 | // or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | #define BOOST_PROGRAM_OPTIONS_SOURCE 7 | #include 8 | 9 | #define BOOST_UTF8_BEGIN_NAMESPACE \ 10 | namespace boost { namespace program_options { namespace detail { 11 | 12 | #define BOOST_UTF8_END_NAMESPACE }}} 13 | #define BOOST_UTF8_DECL BOOST_PROGRAM_OPTIONS_DECL 14 | 15 | #include 16 | 17 | 18 | #undef BOOST_UTF8_BEGIN_NAMESPACE 19 | #undef BOOST_UTF8_END_NAMESPACE 20 | #undef BOOST_UTF8_DECL 21 | 22 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/call_traits.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. 2 | // Use, modification and distribution are subject to the Boost Software License, 3 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt). 5 | // 6 | // See http://www.boost.org/libs/utility for most recent version including documentation. 7 | 8 | // See boost/detail/call_traits.hpp 9 | // for full copyright notices. 10 | 11 | #ifndef BOOST_CALL_TRAITS_HPP 12 | #define BOOST_CALL_TRAITS_HPP 13 | 14 | #ifndef BOOST_CONFIG_HPP 15 | #include 16 | #endif 17 | 18 | #include 19 | 20 | #endif // BOOST_CALL_TRAITS_HPP 21 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/config/platform/beos.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright John Maddock 2001. 2 | // Use, modification and distribution are subject to the 3 | // Boost Software License, Version 1.0. (See accompanying file 4 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // See http://www.boost.org for most recent version. 7 | 8 | // BeOS specific config options: 9 | 10 | #define BOOST_PLATFORM "BeOS" 11 | 12 | #define BOOST_NO_CWCHAR 13 | #define BOOST_NO_CWCTYPE 14 | #define BOOST_HAS_UNISTD_H 15 | 16 | #define BOOST_HAS_BETHREADS 17 | 18 | #ifndef BOOST_DISABLE_THREADS 19 | # define BOOST_HAS_THREADS 20 | #endif 21 | 22 | // boilerplate code: 23 | #include 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/detail/quick_allocator.hpp: -------------------------------------------------------------------------------- 1 | #ifndef BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED 2 | #define BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED 3 | 4 | // MS compatible compilers support #pragma once 5 | 6 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 7 | # pragma once 8 | #endif 9 | 10 | // 11 | // detail/quick_allocator.hpp 12 | // 13 | // Copyright (c) 2003 David Abrahams 14 | // Copyright (c) 2003 Peter Dimov 15 | // 16 | // Distributed under the Boost Software License, Version 1.0. 17 | // See accompanying file LICENSE_1_0.txt or copy at 18 | // http://www.boost.org/LICENSE_1_0.txt 19 | // 20 | 21 | #include 22 | 23 | #endif // #ifndef BOOST_DETAIL_QUICK_ALLOCATOR_HPP_INCLUDED 24 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/contains_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_CONTAINS_FWD_HPP_INCLUDED 3 | #define BOOST_MPL_CONTAINS_FWD_HPP_INCLUDED 4 | 5 | // Copyright Eric Friedman 2002 6 | // Copyright Aleksey Gurtovoy 2004 7 | // 8 | // Distributed under the Boost Software License, Version 1.0. 9 | // (See accompanying file LICENSE_1_0.txt or copy at 10 | // http://www.boost.org/LICENSE_1_0.txt) 11 | // 12 | // See http://www.boost.org/libs/mpl for documentation. 13 | 14 | // $Id$ 15 | // $Date$ 16 | // $Revision$ 17 | 18 | namespace boost { namespace mpl { 19 | 20 | template< typename Tag > struct contains_impl; 21 | template< typename Sequence, typename T > struct contains; 22 | 23 | }} 24 | 25 | #endif // BOOST_MPL_CONTAINS_FWD_HPP_INCLUDED 26 | -------------------------------------------------------------------------------- /src/utils/math/fast_binned.h.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | def encode(num): 4 | if num > 10: 5 | return 10 6 | elif num > 5: 7 | return 6 8 | else: 9 | return num 10 | 11 | token = "" 12 | for i in xrange(1024): 13 | if i%10==0: 14 | token += " " 15 | token += ("%d," % encode(i)) 16 | if (i+ 1) % 10 == 0: 17 | token += "\n" 18 | 19 | print '''#ifndef __LTP_UTILS_MATH_FAST_BINNED_H__ 20 | #define __LTP_UTILS_MATH_FAST_BINNED_H__ 21 | 22 | namespace ltp { 23 | namespace math { 24 | ''' 25 | 26 | print ("static int binned_1_2_3_4_5_6_10[] = {\n%s};" % token) 27 | 28 | print ''' 29 | } // end for math 30 | } // end for ltp 31 | 32 | #endif // end for __LTP_UTILS_MATH_FAST_BINNED_H__ ''' 33 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/size_t.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_SIZE_T_HPP_INCLUDED 3 | #define BOOST_MPL_SIZE_T_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #include 18 | 19 | #define AUX_WRAPPER_VALUE_TYPE std::size_t 20 | #define AUX_WRAPPER_NAME size_t 21 | #define AUX_WRAPPER_PARAMS(N) std::size_t N 22 | 23 | #include 24 | 25 | #endif // BOOST_MPL_SIZE_T_HPP_INCLUDED 26 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/type_traits/promote.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2005 Alexander Nasonov. 2 | // Distributed under the Boost Software License, Version 1.0. (See 3 | // accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | #ifndef FILE_boost_type_traits_promote_hpp_INCLUDED 7 | #define FILE_boost_type_traits_promote_hpp_INCLUDED 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | namespace boost { 14 | 15 | template struct promote : public integral_promotion::type>{}; 16 | 17 | } 18 | 19 | #endif // #ifndef FILE_boost_type_traits_promote_hpp_INCLUDED 20 | 21 | -------------------------------------------------------------------------------- /src/srl/include/base/debug.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2016/12/19. 3 | // 4 | 5 | #include "debug.h" 6 | 7 | base::Debug::Debug(string modelName):modelName(modelName) { 8 | if (enabledModels.count(modelName) || enabledModels.count("*")) { 9 | disable = false; 10 | } 11 | } 12 | 13 | void base::Debug::init(base::DebugConfig config) { 14 | logLevel = config.logLevel; 15 | vector enModelsVec; 16 | boost::split(enModelsVec, config.enabledModels, boost::is_any_of(",")); 17 | enabledModels.clear(); 18 | for (auto i :enModelsVec) { 19 | enabledModels.insert(i); 20 | } 21 | } 22 | 23 | int base::Debug::logLevel = (int)LogLevel::info; 24 | char* base::Debug::tmpBuffer = new char[4096]; 25 | set base::Debug::enabledModels; 26 | 27 | -------------------------------------------------------------------------------- /thirdparty/eigen/Eigen/src/Core/functors/TernaryFunctors.h: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2016 Eugene Brevdo 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_TERNARY_FUNCTORS_H 11 | #define EIGEN_TERNARY_FUNCTORS_H 12 | 13 | namespace Eigen { 14 | 15 | namespace internal { 16 | 17 | //---------- associative ternary functors ---------- 18 | 19 | 20 | 21 | } // end namespace internal 22 | 23 | } // end namespace Eigen 24 | 25 | #endif // EIGEN_TERNARY_FUNCTORS_H 26 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/aligned_storage.hpp: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // boost aligned_storage.hpp header file 3 | // See http://www.boost.org for updates, documentation, and revision history. 4 | //----------------------------------------------------------------------------- 5 | // 6 | // Copyright (c) 2002-2003 7 | // Eric Friedman, Itay Maman 8 | // 9 | // Distributed under the Boost Software License, Version 1.0. (See 10 | // accompanying file LICENSE_1_0.txt or copy at 11 | // http://www.boost.org/LICENSE_1_0.txt) 12 | 13 | #ifndef BOOST_ALIGNED_STORAGE_HPP 14 | #define BOOST_ALIGNED_STORAGE_HPP 15 | 16 | #include 17 | 18 | #endif // BOOST_ALIGNED_STORAGE_HPP 19 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/non_type.hpp: -------------------------------------------------------------------------------- 1 | // ------------------------------------- 2 | // 3 | // (C) Copyright Gennaro Prota 2003. 4 | // 5 | // Distributed under the Boost Software License, Version 1.0. 6 | // (See accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt) 8 | // 9 | // ------------------------------------------------------ 10 | 11 | #ifndef BOOST_NON_TYPE_HPP_GP_20030417 12 | #define BOOST_NON_TYPE_HPP_GP_20030417 13 | 14 | 15 | namespace boost { 16 | 17 | // Just a simple "envelope" for non-type template parameters. Useful 18 | // to work around some MSVC deficiencies. 19 | 20 | template 21 | struct non_type { }; 22 | 23 | 24 | } 25 | 26 | 27 | #endif // include guard 28 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/predef.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2008-2015 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #if !defined(BOOST_PREDEF_H) || defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS) 9 | #ifndef BOOST_PREDEF_H 10 | #define BOOST_PREDEF_H 11 | #endif 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #include 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /thirdparty/eigen/unsupported/doc/examples/PolynomialUtils1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Eigen; 5 | using namespace std; 6 | 7 | int main() 8 | { 9 | Vector4d roots = Vector4d::Random(); 10 | cout << "Roots: " << roots.transpose() << endl; 11 | Eigen::Matrix polynomial; 12 | roots_to_monicPolynomial( roots, polynomial ); 13 | cout << "Polynomial: "; 14 | for( int i=0; i<4; ++i ){ cout << polynomial[i] << ".x^" << i << "+ "; } 15 | cout << polynomial[4] << ".x^4" << endl; 16 | Vector4d evaluation; 17 | for( int i=0; i<4; ++i ){ 18 | evaluation[i] = poly_eval( polynomial, roots[i] ); } 19 | cout << "Evaluation of the polynomial at the roots: " << evaluation.transpose(); 20 | } 21 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/detail/lightweight_mutex.hpp: -------------------------------------------------------------------------------- 1 | #ifndef BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED 2 | #define BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED 3 | 4 | // MS compatible compilers support #pragma once 5 | 6 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 7 | # pragma once 8 | #endif 9 | 10 | // 11 | // boost/detail/lightweight_mutex.hpp - lightweight mutex 12 | // 13 | // Copyright (c) 2002, 2003 Peter Dimov and Multi Media Ltd. 14 | // 15 | // Distributed under the Boost Software License, Version 1.0. 16 | // See accompanying file LICENSE_1_0.txt or copy at 17 | // http://www.boost.org/LICENSE_1_0.txt 18 | // 19 | 20 | #include 21 | 22 | #endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_MUTEX_HPP_INCLUDED 23 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/predef/detail/endian_compat.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2013 3 | Distributed under the Boost Software License, Version 1.0. 4 | (See accompanying file LICENSE_1_0.txt or copy at 5 | http://www.boost.org/LICENSE_1_0.txt) 6 | */ 7 | 8 | #ifndef BOOST_PREDEF_DETAIL_ENDIAN_COMPAT_H 9 | #define BOOST_PREDEF_DETAIL_ENDIAN_COMPAT_H 10 | 11 | #include 12 | 13 | #if BOOST_ENDIAN_BIG_BYTE 14 | # define BOOST_BIG_ENDIAN 15 | # define BOOST_BYTE_ORDER 4321 16 | #endif 17 | #if BOOST_ENDIAN_LITTLE_BYTE 18 | # define BOOST_LITTLE_ENDIAN 19 | # define BOOST_BYTE_ORDER 1234 20 | #endif 21 | #if BOOST_ENDIAN_LITTLE_WORD 22 | # define BOOST_PDP_ENDIAN 23 | # define BOOST_BYTE_ORDER 2134 24 | #endif 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/compressed_pair.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. 2 | // Use, modification and distribution are subject to the Boost Software License, 3 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt). 5 | // 6 | // See http://www.boost.org/libs/utility for most recent version including documentation. 7 | 8 | // See boost/detail/compressed_pair.hpp 9 | // for full copyright notices. 10 | 11 | #ifndef BOOST_COMPRESSED_PAIR_HPP 12 | #define BOOST_COMPRESSED_PAIR_HPP 13 | 14 | #ifndef BOOST_CONFIG_HPP 15 | #include 16 | #endif 17 | 18 | #include 19 | 20 | #endif // BOOST_COMPRESSED_PAIR_HPP 21 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/comparison.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_COMPARISON_HPP_INCLUDED 3 | #define BOOST_MPL_COMPARISON_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #endif // BOOST_MPL_COMPARISON_HPP_INCLUDED 25 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/type_traits/conversion_traits.hpp: -------------------------------------------------------------------------------- 1 | 2 | // Copyright 2000 John Maddock (john@johnmaddock.co.uk) 3 | // Copyright 2000 Jeremy Siek (jsiek@lsc.nd.edu) 4 | // Copyright 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi) 5 | // 6 | // Use, modification and distribution are subject to the Boost Software License, 7 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 8 | // http://www.boost.org/LICENSE_1_0.txt). 9 | // 10 | // See http://www.boost.org/libs/type_traits for most recent version including documentation. 11 | 12 | #ifndef BOOST_TT_CONVERSION_TRAITS_HPP_INCLUDED 13 | #define BOOST_TT_CONVERSION_TRAITS_HPP_INCLUDED 14 | 15 | #include 16 | 17 | #endif // BOOST_TT_CONVERSION_TRAITS_HPP_INCLUDED 18 | -------------------------------------------------------------------------------- /src/ner/extractor.h: -------------------------------------------------------------------------------- 1 | #ifndef __LTP_NER_EXTRACTOR_H__ 2 | #define __LTP_NER_EXTRACTOR_H__ 3 | 4 | #include 5 | #include 6 | #include "ner/instance.h" 7 | #include "utils/template.hpp" 8 | #include "utils/strvec.hpp" 9 | 10 | namespace ltp { 11 | namespace ner { 12 | 13 | class Extractor { 14 | public: 15 | static Extractor& extractor(); 16 | static int num_templates(); 17 | static int extract1o(const Instance& inst, int idx, 18 | std::vector & cache); 19 | 20 | protected: 21 | Extractor(); 22 | ~Extractor(); 23 | private: 24 | static std::vector templates; 25 | }; 26 | 27 | } // end for namespace segmentor 28 | } // end for namespace ltp 29 | 30 | #endif // end for __LTP_NER_EXTRACTOR_H__ 31 | -------------------------------------------------------------------------------- /thirdparty/eigen/unsupported/Eigen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(Eigen_HEADERS 2 | AdolcForward 3 | AlignedVector3 4 | ArpackSupport 5 | AutoDiff 6 | BVH 7 | EulerAngles 8 | FFT 9 | IterativeSolvers 10 | KroneckerProduct 11 | LevenbergMarquardt 12 | MatrixFunctions 13 | MoreVectorization 14 | MPRealSupport 15 | NonLinearOptimization 16 | NumericalDiff 17 | OpenGLSupport 18 | Polynomials 19 | Skyline 20 | SparseExtra 21 | SpecialFunctions 22 | Splines 23 | ) 24 | 25 | install(FILES 26 | ${Eigen_HEADERS} 27 | DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen COMPONENT Devel 28 | ) 29 | 30 | install(DIRECTORY src DESTINATION ${INCLUDE_INSTALL_DIR}/unsupported/Eigen COMPONENT Devel FILES_MATCHING PATTERN "*.h") 31 | 32 | add_subdirectory(CXX11) 33 | -------------------------------------------------------------------------------- /src/unittest/utils_smartmap_unittest.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "utils/smartmap.hpp" 5 | 6 | using ltp::utility::SmartMap; 7 | 8 | TEST(smartmap_unittest, continuous_loading) { 9 | SmartMap dict1; dict1.set("dict1", 1); 10 | SmartMap dict2; dict2.set("dict2", 2); 11 | 12 | std::ofstream ofs("smartmap_unittest.dummyfile", std::ofstream::binary); 13 | dict1.dump(ofs); 14 | dict2.dump(ofs); 15 | ofs.close(); 16 | 17 | std::ifstream ifs("smartmap_unittest.dummyfile", std::ifstream::binary); 18 | SmartMap dict3; dict3.load(ifs); 19 | SmartMap dict4; dict4.load(ifs); 20 | 21 | int val; 22 | dict3.get("dict1", val); EXPECT_EQ(val, 1); 23 | dict4.get("dict2", val); EXPECT_EQ(val, 2); 24 | } 25 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/date_time/special_defs.hpp: -------------------------------------------------------------------------------- 1 | #ifndef DATE_TIME_SPECIAL_DEFS_HPP__ 2 | #define DATE_TIME_SPECIAL_DEFS_HPP__ 3 | 4 | /* Copyright (c) 2002,2003 CrystalClear Software, Inc. 5 | * Use, modification and distribution is subject to the 6 | * Boost Software License, Version 1.0. (See accompanying 7 | * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) 8 | * Author: Jeff Garland 9 | * $Date$ 10 | */ 11 | 12 | namespace boost { 13 | namespace date_time { 14 | 15 | enum special_values {not_a_date_time, 16 | neg_infin, pos_infin, 17 | min_date_time, max_date_time, 18 | not_special, NumSpecialValues}; 19 | 20 | 21 | } } //namespace date_time 22 | 23 | 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/type_traits/add_lvalue_reference.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2010 John Maddock 2 | 3 | // Distributed under the Boost Software License, Version 1.0. 4 | // See http://www.boost.org/LICENSE_1_0.txt 5 | 6 | #ifndef BOOST_TYPE_TRAITS_EXT_ADD_LVALUE_REFERENCE__HPP 7 | #define BOOST_TYPE_TRAITS_EXT_ADD_LVALUE_REFERENCE__HPP 8 | 9 | #include 10 | 11 | namespace boost{ 12 | 13 | template struct add_lvalue_reference 14 | { 15 | typedef typename boost::add_reference::type type; 16 | }; 17 | 18 | #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES 19 | template struct add_lvalue_reference 20 | { 21 | typedef T& type; 22 | }; 23 | #endif 24 | 25 | } 26 | 27 | #endif // BOOST_TYPE_TRAITS_EXT_ADD_LVALUE_REFERENCE__HPP 28 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/type_traits/conditional.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright John Maddock 2010. 2 | // Use, modification and distribution are subject to the Boost Software License, 3 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt). 5 | // 6 | // See http://www.boost.org/libs/type_traits for most recent version including documentation. 7 | 8 | 9 | #ifndef BOOST_TT_CONDITIONAL_HPP_INCLUDED 10 | #define BOOST_TT_CONDITIONAL_HPP_INCLUDED 11 | 12 | namespace boost { 13 | 14 | template struct conditional { typedef T type; }; 15 | template struct conditional { typedef U type; }; 16 | 17 | } // namespace boost 18 | 19 | 20 | #endif // BOOST_TT_CONDITIONAL_HPP_INCLUDED 21 | -------------------------------------------------------------------------------- /src/framework/serializable.h: -------------------------------------------------------------------------------- 1 | #ifndef __LTP_FRAMEWORK_SERIALIZABLE_H__ 2 | #define __LTP_FRAMEWORK_SERIALIZABLE_H__ 3 | 4 | #include 5 | #include "boost/cstdint.hpp" 6 | 7 | namespace ltp { 8 | namespace framework { 9 | 10 | using boost::uint32_t; 11 | 12 | class Serializable { 13 | protected: 14 | void write_uint(std::ostream & out, uint32_t val) const { 15 | out.write(reinterpret_cast(&val), sizeof(uint32_t)); 16 | } 17 | 18 | uint32_t read_uint(std::istream & in) const { 19 | char p[sizeof(uint32_t)]; 20 | in.read(reinterpret_cast(p), sizeof(uint32_t)); 21 | return *reinterpret_cast(p); 22 | } 23 | }; 24 | 25 | } // end for framework 26 | } // end for ltp 27 | 28 | #endif // end for __LTP_FRAMEWORK_SERIALIZABLE_H__ 29 | -------------------------------------------------------------------------------- /thirdparty/eigen/Eigen/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(RegexUtils) 2 | test_escape_string_as_regex() 3 | 4 | file(GLOB Eigen_directory_files "*") 5 | 6 | escape_string_as_regex(ESCAPED_CMAKE_CURRENT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") 7 | 8 | foreach(f ${Eigen_directory_files}) 9 | if(NOT f MATCHES "\\.txt" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/[.].+" AND NOT f MATCHES "${ESCAPED_CMAKE_CURRENT_SOURCE_DIR}/src") 10 | list(APPEND Eigen_directory_files_to_install ${f}) 11 | endif() 12 | endforeach(f ${Eigen_directory_files}) 13 | 14 | install(FILES 15 | ${Eigen_directory_files_to_install} 16 | DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel 17 | ) 18 | 19 | install(DIRECTORY src DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen COMPONENT Devel FILES_MATCHING PATTERN "*.h") 20 | -------------------------------------------------------------------------------- /thirdparty/eigen/unsupported/doc/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | FILE(GLOB examples_SRCS "*.cpp") 2 | 3 | ADD_CUSTOM_TARGET(unsupported_examples) 4 | 5 | INCLUDE_DIRECTORIES(../../../unsupported ../../../unsupported/test) 6 | 7 | FOREACH(example_src ${examples_SRCS}) 8 | GET_FILENAME_COMPONENT(example ${example_src} NAME_WE) 9 | ADD_EXECUTABLE(example_${example} ${example_src}) 10 | if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO) 11 | target_link_libraries(example_${example} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) 12 | endif() 13 | ADD_CUSTOM_COMMAND( 14 | TARGET example_${example} 15 | POST_BUILD 16 | COMMAND example_${example} 17 | ARGS >${CMAKE_CURRENT_BINARY_DIR}/${example}.out 18 | ) 19 | ADD_DEPENDENCIES(unsupported_examples example_${example}) 20 | ENDFOREACH(example_src) 21 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/predef/platform.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright Rene Rivera 2013-2015 3 | Copyright (c) Microsoft Corporation 2014 4 | Distributed under the Boost Software License, Version 1.0. 5 | (See accompanying file LICENSE_1_0.txt or copy at 6 | http://www.boost.org/LICENSE_1_0.txt) 7 | */ 8 | 9 | #if !defined(BOOST_PREDEF_PLATFORM_H) || defined(BOOST_PREDEF_INTERNAL_GENERATE_TESTS) 10 | #ifndef BOOST_PREDEF_PLATFORM_H 11 | #define BOOST_PREDEF_PLATFORM_H 12 | #endif 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | /*#include */ 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /thirdparty/jsoncpp/include/json/autolink.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_AUTOLINK_H_INCLUDED 7 | #define JSON_AUTOLINK_H_INCLUDED 8 | 9 | #include "config.h" 10 | 11 | #ifdef JSON_IN_CPPTL 12 | #include 13 | #endif 14 | 15 | #if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) && \ 16 | !defined(JSON_IN_CPPTL) 17 | #define CPPTL_AUTOLINK_NAME "json" 18 | #undef CPPTL_AUTOLINK_DLL 19 | #ifdef JSON_DLL 20 | #define CPPTL_AUTOLINK_DLL 21 | #endif 22 | #include "autolink.h" 23 | #endif 24 | 25 | #endif // JSON_AUTOLINK_H_INCLUDED 26 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/begin_end_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_BEGIN_END_FWD_HPP_INCLUDED 3 | #define BOOST_MPL_BEGIN_END_FWD_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | namespace boost { namespace mpl { 18 | 19 | template< typename Tag > struct begin_impl; 20 | template< typename Tag > struct end_impl; 21 | 22 | template< typename Sequence > struct begin; 23 | template< typename Sequence > struct end; 24 | 25 | }} 26 | 27 | #endif // BOOST_MPL_BEGIN_END_FWD_HPP_INCLUDED 28 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/type_traits/remove_bounds.hpp: -------------------------------------------------------------------------------- 1 | 2 | // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | // 7 | // See http://www.boost.org/libs/type_traits for most recent version including documentation. 8 | 9 | #ifndef BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED 10 | #define BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED 11 | 12 | #include 13 | 14 | namespace boost 15 | { 16 | 17 | template struct remove_bounds : public remove_extent {}; 18 | 19 | } // namespace boost 20 | 21 | #endif // BOOST_TT_REMOVE_BOUNDS_HPP_INCLUDED 22 | -------------------------------------------------------------------------------- /thirdparty/eigen/Eigen/StdList: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2009 Hauke Heibel 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_STDLIST_MODULE_H 11 | #define EIGEN_STDLIST_MODULE_H 12 | 13 | #include "Core" 14 | #include 15 | 16 | #if EIGEN_COMP_MSVC && EIGEN_OS_WIN64 /* MSVC auto aligns in 64 bit builds */ 17 | 18 | #define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...) 19 | 20 | #else 21 | 22 | #include "src/StlSupport/StdList.h" 23 | 24 | #endif 25 | 26 | #endif // EIGEN_STDLIST_MODULE_H 27 | -------------------------------------------------------------------------------- /src/postagger/extractor.h: -------------------------------------------------------------------------------- 1 | #ifndef __LTP_POSTAGGER_EXTRACTOR_H__ 2 | #define __LTP_POSTAGGER_EXTRACTOR_H__ 3 | 4 | #include 5 | #include 6 | 7 | #include "postagger/instance.h" 8 | #include "utils/template.hpp" 9 | #include "utils/strvec.hpp" 10 | 11 | namespace ltp { 12 | namespace postagger { 13 | 14 | class Extractor { 15 | public: 16 | static Extractor& extractor(); 17 | static int num_templates(); 18 | static int extract1o(const Instance& inst, int idx, 19 | std::vector& cache); 20 | protected: 21 | Extractor(); 22 | ~Extractor(); 23 | private: 24 | static std::vector< utility::Template * > templates; 25 | }; 26 | 27 | } // end for namespace postagger 28 | } // end for namespace ltp 29 | 30 | #endif // end for __LTP_POSTAGGER_EXTRACTOR_H__ 31 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/is_placeholder.hpp: -------------------------------------------------------------------------------- 1 | #ifndef BOOST_IS_PLACEHOLDER_HPP_INCLUDED 2 | #define BOOST_IS_PLACEHOLDER_HPP_INCLUDED 3 | 4 | // MS compatible compilers support #pragma once 5 | 6 | #if defined( _MSC_VER ) && ( _MSC_VER >= 1020 ) 7 | # pragma once 8 | #endif 9 | 10 | 11 | // is_placeholder.hpp - TR1 is_placeholder metafunction 12 | // 13 | // Copyright (c) 2006 Peter Dimov 14 | // 15 | // Distributed under the Boost Software License, Version 1.0. 16 | // 17 | // See accompanying file LICENSE_1_0.txt or copy at 18 | // http://www.boost.org/LICENSE_1_0.txt 19 | 20 | 21 | namespace boost 22 | { 23 | 24 | template< class T > struct is_placeholder 25 | { 26 | enum _vt { value = 0 }; 27 | }; 28 | 29 | } // namespace boost 30 | 31 | #endif // #ifndef BOOST_IS_PLACEHOLDER_HPP_INCLUDED 32 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/spirit/home/classic/core/nil.hpp: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | Copyright (c) 2001-2003 Joel de Guzman 3 | http://spirit.sourceforge.net/ 4 | 5 | Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | =============================================================================*/ 8 | #if !defined(BOOST_SPIRIT_NIL_HPP) 9 | #define BOOST_SPIRIT_NIL_HPP 10 | 11 | #include 12 | 13 | namespace boost { namespace spirit { 14 | 15 | BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN 16 | 17 | struct nil_t {}; 18 | 19 | BOOST_SPIRIT_CLASSIC_NAMESPACE_END 20 | 21 | }} 22 | 23 | #endif 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories (./ 2 | ${SOURCE_DIR}/ 3 | ${THIRDPARTY_DIR}/boost/include/ 4 | ${THIRDPARTY_DIR}/maxent/ 5 | ${THIRDPARTY_DIR}/tinyxml/ 6 | ${THIRDPARTY_DIR}/jsoncpp/include) 7 | 8 | set (ltp_server_SRC ltp_server.cpp mongoose.c mongoose.h) 9 | link_directories ( ${LIBRARY_OUTPUT_PATH} ) 10 | add_executable (ltp_server ${ltp_server_SRC}) 11 | target_link_libraries (ltp_server 12 | maxent_static_lib 13 | ltp 14 | splitsnt_static_lib 15 | segmentor_static_lib 16 | postagger_static_lib 17 | parser_static_lib 18 | ner_static_lib 19 | srl_static_lib 20 | xml4nlp 21 | pthread 22 | boost_program_options_static_lib 23 | boost_regex_static_lib 24 | boost_serialization_static_lib 25 | dl 26 | dynet 27 | jsoncpp_lib_static) 28 | -------------------------------------------------------------------------------- /src/srl/include/extractor/Extractor.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/1/2. 3 | // 4 | 5 | #ifndef PROJECT_ERACTOR_H 6 | #define PROJECT_ERACTOR_H 7 | 8 | #include "AbstractExtractor.h" 9 | 10 | #include "vector" 11 | using namespace std; 12 | 13 | namespace extractor { 14 | template 15 | class Extractor : public AbstractExtractor, vector>{ 16 | public: 17 | vector * startPtr; 18 | 19 | virtual void init(vector& start) { 20 | startPtr = &start; 21 | }; 22 | 23 | virtual vector run() = 0; 24 | 25 | static string getClassName() { 26 | return "Extractor<" + StartClass::getClassName() + ", " + EndClass::getClassName() + ">"; 27 | } 28 | }; 29 | } 30 | 31 | #endif //PROJECT_ERACTOR_H 32 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/advance_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_ADVANCE_FWD_HPP_INCLUDED 3 | #define BOOST_MPL_ADVANCE_FWD_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #include 18 | 19 | namespace boost { namespace mpl { 20 | 21 | BOOST_MPL_AUX_COMMON_NAME_WKND(advance) 22 | 23 | template< typename Tag > struct advance_impl; 24 | template< typename Iterator, typename N > struct advance; 25 | 26 | }} 27 | 28 | #endif // BOOST_MPL_ADVANCE_FWD_HPP_INCLUDED 29 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/distance_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_DISTANCE_FWD_HPP_INCLUDED 3 | #define BOOST_MPL_DISTANCE_FWD_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #include 18 | 19 | namespace boost { namespace mpl { 20 | 21 | BOOST_MPL_AUX_COMMON_NAME_WKND(distance) 22 | 23 | template< typename Tag > struct distance_impl; 24 | template< typename First, typename Last > struct distance; 25 | 26 | }} 27 | 28 | #endif // BOOST_MPL_DISTANCE_FWD_HPP_INCLUDED 29 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/inserter.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_INSERTER_HPP_INCLUDED 3 | #define BOOST_MPL_INSERTER_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2003-2004 6 | // Copyright David Abrahams 2003-2004 7 | // 8 | // Distributed under the Boost Software License, Version 1.0. 9 | // (See accompanying file LICENSE_1_0.txt or copy at 10 | // http://www.boost.org/LICENSE_1_0.txt) 11 | // 12 | // See http://www.boost.org/libs/mpl for documentation. 13 | 14 | // $Id$ 15 | // $Date$ 16 | // $Revision$ 17 | 18 | namespace boost { namespace mpl { 19 | 20 | template< 21 | typename Sequence 22 | , typename Operation 23 | > 24 | struct inserter 25 | { 26 | typedef Sequence state; 27 | typedef Operation operation; 28 | }; 29 | 30 | }} 31 | 32 | #endif // BOOST_MPL_INSERTER_HPP_INCLUDED 33 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/list/list0_c.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_LIST_LIST0_C_HPP_INCLUDED 3 | #define BOOST_MPL_LIST_LIST0_C_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #include 18 | #include 19 | 20 | namespace boost { namespace mpl { 21 | 22 | template< typename T > struct list0_c 23 | : l_end 24 | { 25 | typedef l_end type; 26 | typedef T value_type; 27 | }; 28 | 29 | }} 30 | 31 | #endif // BOOST_MPL_LIST_LIST0_C_HPP_INCLUDED 32 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/int_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_INT_FWD_HPP_INCLUDED 3 | #define BOOST_MPL_INT_FWD_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #include 18 | #include 19 | 20 | BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN 21 | 22 | template< BOOST_MPL_AUX_NTTP_DECL(int, N) > struct int_; 23 | 24 | BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE 25 | BOOST_MPL_AUX_ADL_BARRIER_DECL(int_) 26 | 27 | #endif // BOOST_MPL_INT_FWD_HPP_INCLUDED 28 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/long_fwd.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_LONG_FWD_HPP_INCLUDED 3 | #define BOOST_MPL_LONG_FWD_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #include 18 | #include 19 | 20 | BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN 21 | 22 | template< BOOST_MPL_AUX_NTTP_DECL(long, N) > struct long_; 23 | 24 | BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE 25 | BOOST_MPL_AUX_ADL_BARRIER_DECL(long_) 26 | 27 | #endif // BOOST_MPL_LONG_FWD_HPP_INCLUDED 28 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/range/functions.hpp: -------------------------------------------------------------------------------- 1 | // Boost.Range library 2 | // 3 | // Copyright Thorsten Ottosen 2003-2006. Use, modification and 4 | // distribution is subject to the Boost Software License, Version 5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | // 8 | // For more information, see http://www.boost.org/libs/range/ 9 | // 10 | 11 | #ifndef BOOST_RANGE_FUNCTIONS_HPP 12 | #define BOOST_RANGE_FUNCTIONS_HPP 13 | 14 | #if defined(_MSC_VER) 15 | # pragma once 16 | #endif 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/type_traits/has_unary_plus.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright 2009-2011 Frederic Bron. 2 | // 3 | // Use, modification and distribution are subject to the Boost Software License, 4 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 | // http://www.boost.org/LICENSE_1_0.txt). 6 | // 7 | // See http://www.boost.org/libs/type_traits for most recent version including documentation. 8 | 9 | #ifndef BOOST_TT_HAS_UNARY_PLUS_HPP_INCLUDED 10 | #define BOOST_TT_HAS_UNARY_PLUS_HPP_INCLUDED 11 | 12 | #define BOOST_TT_TRAIT_NAME has_unary_plus 13 | #define BOOST_TT_TRAIT_OP + 14 | #define BOOST_TT_FORBIDDEN_IF\ 15 | false 16 | 17 | #include 18 | 19 | #undef BOOST_TT_TRAIT_NAME 20 | #undef BOOST_TT_TRAIT_OP 21 | #undef BOOST_TT_FORBIDDEN_IF 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /thirdparty/jsoncpp/include/json/version.h: -------------------------------------------------------------------------------- 1 | // DO NOT EDIT. This file (and "version") is generated by CMake. 2 | // Run CMake configure step to update it. 3 | #ifndef JSON_VERSION_H_INCLUDED 4 | # define JSON_VERSION_H_INCLUDED 5 | 6 | # define JSONCPP_VERSION_STRING "1.7.7" 7 | # define JSONCPP_VERSION_MAJOR 1 8 | # define JSONCPP_VERSION_MINOR 7 9 | # define JSONCPP_VERSION_PATCH 7 10 | # define JSONCPP_VERSION_QUALIFIER 11 | # define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8)) 12 | 13 | #ifdef JSONCPP_USING_SECURE_MEMORY 14 | #undef JSONCPP_USING_SECURE_MEMORY 15 | #endif 16 | #define JSONCPP_USING_SECURE_MEMORY 0 17 | // If non-zero, the library zeroes any memory that it has allocated before 18 | // it frees its memory. 19 | 20 | #endif // JSON_VERSION_H_INCLUDED 21 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/iterator/detail/config_undef.hpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright Thomas Witt 2002. 2 | // Distributed under the Boost Software License, Version 1.0. (See 3 | // accompanying file LICENSE_1_0.txt or copy at 4 | // http://www.boost.org/LICENSE_1_0.txt) 5 | 6 | // no include guard multiple inclusion intended 7 | 8 | // 9 | // This is a temporary workaround until the bulk of this is 10 | // available in boost config. 11 | // 23/02/03 thw 12 | // 13 | 14 | #undef BOOST_NO_IS_CONVERTIBLE 15 | #undef BOOST_NO_IS_CONVERTIBLE_TEMPLATE 16 | #undef BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY 17 | #undef BOOST_NO_LVALUE_RETURN_DETECTION 18 | #undef BOOST_NO_ONE_WAY_ITERATOR_INTEROP 19 | 20 | #ifdef BOOST_ITERATOR_CONFIG_DEF 21 | # undef BOOST_ITERATOR_CONFIG_DEF 22 | #else 23 | # error missing or nested #include config_def 24 | #endif 25 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/mpl/aux_/config/static_constant.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BOOST_MPL_AUX_CONFIG_STATIC_CONSTANT_HPP_INCLUDED 3 | #define BOOST_MPL_AUX_CONFIG_STATIC_CONSTANT_HPP_INCLUDED 4 | 5 | // Copyright Aleksey Gurtovoy 2000-2004 6 | // 7 | // Distributed under the Boost Software License, Version 1.0. 8 | // (See accompanying file LICENSE_1_0.txt or copy at 9 | // http://www.boost.org/LICENSE_1_0.txt) 10 | // 11 | // See http://www.boost.org/libs/mpl for documentation. 12 | 13 | // $Id$ 14 | // $Date$ 15 | // $Revision$ 16 | 17 | #if !defined(BOOST_MPL_PREPROCESSING_MODE) 18 | // BOOST_STATIC_CONSTANT is defined here: 19 | # include 20 | #else 21 | // undef the macro for the preprocessing mode 22 | # undef BOOST_STATIC_CONSTANT 23 | #endif 24 | 25 | #endif // BOOST_MPL_AUX_CONFIG_STATIC_CONSTANT_HPP_INCLUDED 26 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/preprocessor/dec.hpp: -------------------------------------------------------------------------------- 1 | # /* ************************************************************************** 2 | # * * 3 | # * (C) Copyright Paul Mensonides 2002. 4 | # * Distributed under the Boost Software License, Version 1.0. (See 5 | # * accompanying file LICENSE_1_0.txt or copy at 6 | # * http://www.boost.org/LICENSE_1_0.txt) 7 | # * * 8 | # ************************************************************************** */ 9 | # 10 | # /* See http://www.boost.org for most recent version. */ 11 | # 12 | # ifndef BOOST_PREPROCESSOR_DEC_HPP 13 | # define BOOST_PREPROCESSOR_DEC_HPP 14 | # 15 | # include 16 | # 17 | # endif 18 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/preprocessor/inc.hpp: -------------------------------------------------------------------------------- 1 | # /* ************************************************************************** 2 | # * * 3 | # * (C) Copyright Paul Mensonides 2002. 4 | # * Distributed under the Boost Software License, Version 1.0. (See 5 | # * accompanying file LICENSE_1_0.txt or copy at 6 | # * http://www.boost.org/LICENSE_1_0.txt) 7 | # * * 8 | # ************************************************************************** */ 9 | # 10 | # /* See http://www.boost.org for most recent version. */ 11 | # 12 | # ifndef BOOST_PREPROCESSOR_INC_HPP 13 | # define BOOST_PREPROCESSOR_INC_HPP 14 | # 15 | # include 16 | # 17 | # endif 18 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/preprocessor/slot.hpp: -------------------------------------------------------------------------------- 1 | # /* ************************************************************************** 2 | # * * 3 | # * (C) Copyright Paul Mensonides 2002. 4 | # * Distributed under the Boost Software License, Version 1.0. (See 5 | # * accompanying file LICENSE_1_0.txt or copy at 6 | # * http://www.boost.org/LICENSE_1_0.txt) 7 | # * * 8 | # ************************************************************************** */ 9 | # 10 | # /* See http://www.boost.org for most recent version. */ 11 | # 12 | # ifndef BOOST_PREPROCESSOR_SLOT_HPP 13 | # define BOOST_PREPROCESSOR_SLOT_HPP 14 | # 15 | # include 16 | # 17 | # endif 18 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/visit_each.hpp: -------------------------------------------------------------------------------- 1 | // Boost.Signals library 2 | 3 | // Copyright Douglas Gregor 2001-2003. Use, modification and 4 | // distribution is subject to the Boost Software License, Version 5 | // 1.0. (See accompanying file LICENSE_1_0.txt or copy at 6 | // http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | // For more information, see http://www.boost.org/libs/signals 9 | 10 | #ifndef BOOST_VISIT_EACH_HPP 11 | #define BOOST_VISIT_EACH_HPP 12 | 13 | namespace boost { 14 | template 15 | inline void visit_each(Visitor& visitor, const T& t, long) 16 | { 17 | visitor(t); 18 | } 19 | 20 | template 21 | inline void visit_each(Visitor& visitor, const T& t) 22 | { 23 | visit_each(visitor, t, 0); 24 | } 25 | } 26 | 27 | #endif // BOOST_VISIT_EACH_HPP 28 | -------------------------------------------------------------------------------- /src/segmentor/model.cpp: -------------------------------------------------------------------------------- 1 | #include "segmentor/model.h" 2 | #include "segmentor/extractor.h" 3 | #include 4 | 5 | namespace ltp { 6 | namespace segmentor { 7 | 8 | using framework::Parameters; 9 | 10 | Model::Model(): framework::Model(Extractor::num_templates()){} 11 | Model::~Model() {} 12 | 13 | void Model::save(const char* model_name, const Parameters::DumpOption& opt, 14 | std::ostream& ofs) { 15 | framework::Model::save(model_name, opt, ofs); 16 | internal_lexicon.dump(ofs); 17 | } 18 | 19 | bool Model::load(const char* model_name, std::istream& ifs) { 20 | if (!framework::Model::load(model_name, ifs)) { 21 | return false; 22 | } 23 | if (!internal_lexicon.load(ifs)) { 24 | return false; 25 | } 26 | 27 | return true; 28 | } 29 | 30 | } // end for namespace segmentor 31 | } // end for namespace ltp 32 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/config/abi_prefix.hpp: -------------------------------------------------------------------------------- 1 | // abi_prefix header -------------------------------------------------------// 2 | 3 | // (c) Copyright John Maddock 2003 4 | 5 | // Use, modification and distribution are subject to the Boost Software License, 6 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 7 | // http://www.boost.org/LICENSE_1_0.txt). 8 | 9 | #ifndef BOOST_CONFIG_ABI_PREFIX_HPP 10 | # define BOOST_CONFIG_ABI_PREFIX_HPP 11 | #else 12 | # error double inclusion of header boost/config/abi_prefix.hpp is an error 13 | #endif 14 | 15 | #include 16 | 17 | // this must occur after all other includes and before any code appears: 18 | #ifdef BOOST_HAS_ABI_HEADERS 19 | # include BOOST_ABI_PREFIX 20 | #endif 21 | 22 | #if defined( __BORLANDC__ ) 23 | #pragma nopushoptwarn 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/preprocessor/enum.hpp: -------------------------------------------------------------------------------- 1 | # /* ************************************************************************** 2 | # * * 3 | # * (C) Copyright Paul Mensonides 2002. 4 | # * Distributed under the Boost Software License, Version 1.0. (See 5 | # * accompanying file LICENSE_1_0.txt or copy at 6 | # * http://www.boost.org/LICENSE_1_0.txt) 7 | # * * 8 | # ************************************************************************** */ 9 | # 10 | # /* See http://www.boost.org for most recent version. */ 11 | # 12 | # ifndef BOOST_PREPROCESSOR_ENUM_HPP 13 | # define BOOST_PREPROCESSOR_ENUM_HPP 14 | # 15 | # include 16 | # 17 | # endif 18 | -------------------------------------------------------------------------------- /src/srl/include/extractor/ConverterBlockToConcept.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by liu on 2017/1/2. 3 | // 4 | 5 | #ifndef PROJECT_CONVERTERBLOCKTOCONCEPT_H 6 | #define PROJECT_CONVERTERBLOCKTOCONCEPT_H 7 | 8 | #include "BiConverter.h" 9 | #include "../structure/DataFileBlockContext.h" 10 | #include "../structure/DataConcept.h" 11 | #include "../base/debug.h" 12 | 13 | 14 | namespace extractor { 15 | template 16 | class ConverterBlockToConcept: public BiConverter { 17 | public: 18 | base::Debug debug; 19 | ConverterBlockToConcept():debug("ConverterBlockToConcept") {} 20 | 21 | virtual void convert(T1 & fileBlock) { 22 | debug.debug("testing ConverterBlockToConcept Class - convert foo."); 23 | } 24 | }; 25 | } 26 | 27 | 28 | #endif //PROJECT_CONVERTERBLOCKTOCONCEPT_H 29 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/filesystem.hpp: -------------------------------------------------------------------------------- 1 | // boost/filesystem.hpp --------------------------------------------------------------// 2 | 3 | // Copyright Beman Dawes 2010 4 | 5 | // Distributed under the Boost Software License, Version 1.0. 6 | // See http://www.boost.org/LICENSE_1_0.txt 7 | 8 | // Library home page: http://www.boost.org/libs/filesystem 9 | 10 | //--------------------------------------------------------------------------------------// 11 | 12 | #ifndef BOOST_FILESYSTEM_FILESYSTEM_HPP 13 | #define BOOST_FILESYSTEM_FILESYSTEM_HPP 14 | 15 | # include 16 | # include 17 | # include 18 | # include 19 | # include 20 | 21 | #endif // BOOST_FILESYSTEM_FILESYSTEM_HPP 22 | -------------------------------------------------------------------------------- /thirdparty/boost/include/boost/interprocess/detail/config_external_begin.hpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // (C) Copyright Ion Gaztanaga 2012-2012. Distributed under the Boost 4 | // Software License, Version 1.0. (See accompanying file 5 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 | // 7 | // See http://www.boost.org/libs/interprocess for documentation. 8 | // 9 | ////////////////////////////////////////////////////////////////////////////// 10 | #ifndef BOOST_INTERPROCESS_EXTERNAL_CONFIG_INCLUDED 11 | #define BOOST_INTERPROCESS_EXTERNAL_CONFIG_INCLUDED 12 | #include 13 | #endif 14 | 15 | #if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 406) 16 | # pragma GCC diagnostic push 17 | # pragma GCC diagnostic ignored "-Wshadow" 18 | #endif 19 | --------------------------------------------------------------------------------