diff --git a/swig/CMakeLists.txt b/swig/CMakeLists.txt index 4343771ff892a11362062512c06006ae7257e285..52bf2156611cfecfb7e9dc6563f5ffd9d64ad1eb 100644 --- a/swig/CMakeLists.txt +++ b/swig/CMakeLists.txt @@ -34,6 +34,8 @@ if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -fno-omit-frame-pointer") endif(CMAKE_COMPILER_IS_GNUCXX) +file(GLOB_RECURSE I_FILES "*.i") + # ----------------------------------------------------------------------------- # ----------------------------------------------------------------------------- @@ -44,10 +46,10 @@ SET(SWIG_SRC_DIR ${SWIG_DIR}/libcorpus2) # corous2 SET_SOURCE_FILES_PROPERTIES(corpus2.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(corpus2.i PROPERTIES SWIG_FLAGS "-includeall" ) +set(SWIG_MODULE_corpus2_EXTRA_DEPS ${I_FILES}) SWIG_ADD_MODULE(corpus2 python corpus2.i ) SWIG_LINK_LIBRARIES(corpus2 ${PYTHON_LIBRARIES} ${PWRUTILS_LIBS}) SWIG_LINK_LIBRARIES(corpus2 ${PYTHON_LIBRARIES} ${CORPUS2_PWR_LIBS}) - # ----------------------------------------------------------------------------- # ----------------------------------------------------------------------------- @@ -89,25 +91,7 @@ install( # ----------------------------------------------------------------------------- install( - FILES libpwrnlperror.i - libcorpus2exception.i - libcorpus2exception.i - libcorpustag.i - libcorpustagset.i - libcorpustagsetmanager.i - libcorpuslexeme.i - libcorpustoken.i - libcorpussentence.i - libcorpuschunk.i - libcorpustokenwriter.i - libcorpustokenreader.i - libcorpusiob.i - libcorpusannotationchannel.i - libcorpusannotatedsentence.i - libcorpusannotationview.i - corpus2.i - boost_shared_ptr.i - unicodestring.i + FILES ${I_FILES} DESTINATION ${SWIG_SRC_DIR} PERMISSIONS ${PERM_SCRIPTS} ) diff --git a/swig/libcorpusannotatedsentence.i b/swig/annotatedsentence.i similarity index 93% rename from swig/libcorpusannotatedsentence.i rename to swig/annotatedsentence.i index f7c27b109a0f30fdebc2fb2cfb3184d964abde29..ae04681f32803aed75973a86dce4ab8cc0b2a3be 100644 --- a/swig/libcorpusannotatedsentence.i +++ b/swig/annotatedsentence.i @@ -6,10 +6,10 @@ #include <libcorpus2/ann/annotatedsentence.h> %} -%include "libcorpustoken.i" -%include "libcorpussentence.i" -%include "libcorpus2exception.i" -%include "libcorpusannotationchannel.i" +%include "token.i" +%include "sentence.i" +%include "exception.i" +%include "annotationchannel.i" %include "boost_shared_ptr.i" %include "std_map.i" diff --git a/swig/libcorpusannotationchannel.i b/swig/annotationchannel.i similarity index 98% rename from swig/libcorpusannotationchannel.i rename to swig/annotationchannel.i index 91a79291452b17a233a32eb4e679a35c418ee184..4010424e180a6d9033e7d03ff9c6bb52f249f9f5 100644 --- a/swig/libcorpusannotationchannel.i +++ b/swig/annotationchannel.i @@ -8,7 +8,7 @@ %include "std_string.i" %include "std_vector.i" -%include "libcorpusiob.i" +%include "iob.i" %template(IntVector) std::vector<int>; %template(IOBVector) std::vector<Corpus2::IOB::Enum>; diff --git a/swig/libcorpusannotationview.i b/swig/annotationview.i similarity index 90% rename from swig/libcorpusannotationview.i rename to swig/annotationview.i index 2f41a0aa98ca3cddf05575957f3d6d6e46090f24..c909f4bd2422fd20bbe07081a8e3104f2191ea8d 100644 --- a/swig/libcorpusannotationview.i +++ b/swig/annotationview.i @@ -6,9 +6,9 @@ #include <libcorpus2/ann/view.h> %} -%include "libcorpussentence.i" -%include "libcorpusannotationchannel.i" -%include "libcorpusannotatedsentence.i" +%include "sentence.i" +%include "annotationchannel.i" +%include "annotatedsentence.i" %include "std_string.i" %include "boost_shared_ptr.i" diff --git a/swig/libcorpuschunk.i b/swig/chunk.i similarity index 97% rename from swig/libcorpuschunk.i rename to swig/chunk.i index df798640ec75a6ac7f0ddfd113c4aeb3050f82ce..ac9b2e0b90de7c049d1807f6097170d4b83d224a 100644 --- a/swig/libcorpuschunk.i +++ b/swig/chunk.i @@ -14,7 +14,7 @@ %include "std_vector.i" %include "boost_shared_ptr.i" -%include "libcorpussentence.i" +%include "sentence.i" %template(ChunkPtr) boost::shared_ptr<Corpus2::Chunk>; %template(SentencePtrVector) std::vector<boost::shared_ptr<Sentence> >; diff --git a/swig/corpus2.i b/swig/corpus2.i index 087727cda465a2a2dd8cf328bc2db988843ec93c..b4ccbc7ea358d4e5ceea856f7f63ab520ab4ecd7 100644 --- a/swig/corpus2.i +++ b/swig/corpus2.i @@ -5,20 +5,20 @@ %include "boost_shared_ptr.i" %include "unicodestring.i" -%include "libcorpus2exception.i" -%include "libcorpusannotatedsentence.i" -%include "libcorpusannotationchannel.i" -%include "libcorpusannotationview.i" -%include "libcorpuschunk.i" -%include "libcorpusiob.i" -%include "libcorpuslexeme.i" -%include "libcorpussentence.i" -%include "libcorpustag.i" -%include "libcorpustagset.i" -%include "libcorpustagsetmanager.i" -%include "libcorpustoken.i" -%include "libcorpustokenreader.i" -%include "libcorpustokenwriter.i" +%include "exception.i" +%include "annotatedsentence.i" +%include "annotationchannel.i" +%include "annotationview.i" +%include "chunk.i" +%include "iob.i" +%include "lexeme.i" +%include "sentence.i" +%include "tag.i" +%include "tagset.i" +%include "tagsetmanager.i" +%include "token.i" +%include "tokenreader.i" +%include "tokenwriter.i" %include "libpwrnlperror.i" #endif /* SWIG_CORPUS2_I */ diff --git a/swig/libcorpus2exception.i b/swig/exception.i similarity index 96% rename from swig/libcorpus2exception.i rename to swig/exception.i index 2ee4463ae619ffa4dd80c12e1aec8161682c2369..97295ea7eda9fe26a02fc6200c03bd8d9c542700 100644 --- a/swig/libcorpus2exception.i +++ b/swig/exception.i @@ -1,7 +1,7 @@ #ifndef SWIG_LIBCORPUS2_EXCEPTION_I #define SWIG_LIBCORPUS2_EXCEPTION_I -%module libcorpus2exception +%module libcorpusexception %{ #include <libcorpus2/exception.h> %} diff --git a/swig/libcorpusiob.i b/swig/iob.i similarity index 100% rename from swig/libcorpusiob.i rename to swig/iob.i diff --git a/swig/libcorpuslexeme.i b/swig/lexeme.i similarity index 97% rename from swig/libcorpuslexeme.i rename to swig/lexeme.i index e962845b00b107b7b538c3325819f2bfde3d95c4..964f434416d26d7f56b612f35bd86c13104efc7e 100644 --- a/swig/libcorpuslexeme.i +++ b/swig/lexeme.i @@ -7,7 +7,7 @@ #include <libcorpus2/lexeme.h> %} -%include "libcorpustag.i" +%include "tag.i" %include "std_string.i" %include "std_vector.i" diff --git a/swig/libcorpussentence.i b/swig/sentence.i similarity index 97% rename from swig/libcorpussentence.i rename to swig/sentence.i index be08a46d7a9a32f0d8b04fa1f40c7d519e6601a4..4d7a14da05e769489c65579f9d8713675f168f53 100644 --- a/swig/libcorpussentence.i +++ b/swig/sentence.i @@ -7,7 +7,7 @@ %} %include "std_string.i" -%include "libcorpustoken.i" +%include "token.i" %include "boost_shared_ptr.i" %template(Ptr) boost::shared_ptr<Corpus2::Sentence>; diff --git a/swig/libcorpustag.i b/swig/tag.i similarity index 100% rename from swig/libcorpustag.i rename to swig/tag.i diff --git a/swig/libcorpustagset.i b/swig/tagset.i similarity index 98% rename from swig/libcorpustagset.i rename to swig/tagset.i index 4b469a69295342a49ff34baec8f50bb2c6464735..c4a5dad26fea19da8e70f290f22f45dc0a1df6ad 100644 --- a/swig/libcorpustagset.i +++ b/swig/tagset.i @@ -6,8 +6,8 @@ #include <libcorpus2/tagset.h> %} -%include "libcorpustag.i" -%include "libcorpus2exception.i" +%include "tag.i" +%include "exception.i" %include "std_string.i" %include "std_vector.i" diff --git a/swig/libcorpustagsetmanager.i b/swig/tagsetmanager.i similarity index 96% rename from swig/libcorpustagsetmanager.i rename to swig/tagsetmanager.i index adc0b4c9aa55c8310043c97e3ab6d248c1b8eaac..a4aa9f4df135ef5273ec4affa998007d5a993801 100644 --- a/swig/libcorpustagsetmanager.i +++ b/swig/tagsetmanager.i @@ -6,8 +6,8 @@ #include <libcorpus2/tagsetmanager.h> %} -%include "libcorpustagset.i" -%include "libcorpus2exception.i" +%include "tagset.i" +%include "exception.i" %include "std_string.i" %include "std_vector.i" diff --git a/swig/libcorpustoken.i b/swig/token.i similarity index 96% rename from swig/libcorpustoken.i rename to swig/token.i index 5d81bba2580a9fe4a3236f505c70345e51ad73f1..0c8373f6edea713c9a1da0d12a571663ab814b5c 100644 --- a/swig/libcorpustoken.i +++ b/swig/token.i @@ -7,8 +7,8 @@ #include <libcorpus2/token.h> %} -%include "libcorpuslexeme.i" -%include "libcorpustagset.i" +%include "lexeme.i" +%include "tagset.i" %include "std_string.i" %include "std_vector.i" diff --git a/swig/libcorpustokenreader.i b/swig/tokenreader.i similarity index 95% rename from swig/libcorpustokenreader.i rename to swig/tokenreader.i index ef2f16cb1e7fd19f01560be26fa64b1a518d5e33..038da5cd93285c131c3e00ff75de50cd732a7e9d 100644 --- a/swig/libcorpustokenreader.i +++ b/swig/tokenreader.i @@ -7,11 +7,11 @@ #include <libcorpus2/io/helpers.h> %} -%include "libcorpustag.i" -%include "libcorpustoken.i" -%include "libcorpuschunk.i" -%include "libcorpustagset.i" -%include "libcorpussentence.i" +%include "tag.i" +%include "token.i" +%include "chunk.i" +%include "tagset.i" +%include "sentence.i" %include "std_string.i" %include "std_vector.i" %include "boost_shared_ptr.i" diff --git a/swig/libcorpustokenwriter.i b/swig/tokenwriter.i similarity index 93% rename from swig/libcorpustokenwriter.i rename to swig/tokenwriter.i index 50ad969ab890b83f4fe22fc2ef5156bddce69932..285c81f88dc5b92f13765dae27eb05af03b94160 100644 --- a/swig/libcorpustokenwriter.i +++ b/swig/tokenwriter.i @@ -6,11 +6,11 @@ #include <libcorpus2/io/writer.h> %} -%include "libcorpustag.i" -%include "libcorpustoken.i" -%include "libcorpuschunk.i" -%include "libcorpustagset.i" -%include "libcorpussentence.i" +%include "tag.i" +%include "token.i" +%include "chunk.i" +%include "tagset.i" +%include "sentence.i" %include "std_string.i" %include "boost_shared_ptr.i"