Skip to content
Snippets Groups Projects
Commit f1a77980 authored by Johannes Heinecke's avatar Johannes Heinecke
Browse files

programme test pour l'export

parent 53eea287
No related branches found
No related tags found
1 merge request!7Johannes
This commit is part of merge request !7. Comments created here will be created in the context of that merge request.
......@@ -12,6 +12,8 @@ if (${CMAKE_C_COMPILER_VERSION} VERSION_LESS 5.3)
#set_property(GLOBAL PROPERTY C_STANDARD 11)
endif()
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3")
# activate with cmake -DMACA_EXPORT=TRUE
# to use macaon in python/java (with swig)
if(MACA_EXPORT)
......
......@@ -94,6 +94,31 @@ if(MACA_EXPORT)
else()
message("swig >= 3.0 not installed on your system")
endif()
set(TESTSOURCES
src/maca_lemmatizer_export.cc
src/maca_trans_parser_export.cc
src/maca_trans_tagger_export.cc
)
# #compiling library
# include_directories(src)
# add_library(swigtransparse ${TESOURCES})
#target_link_libraries(transparse perceptron)
add_executable(testcxx ./src/test.cc ${TESTSOURCES})
target_link_libraries(testcxx perceptron)
target_link_libraries(testcxx transparse)
target_link_libraries(testcxx maca_common)
# install (TARGETS testcxx DESTINATION bin)
endif()
#include <iostream>
#include <fstream>
#include "maca_lemmatizer_export.h"
#include "maca_trans_parser_export.h"
#include "maca_trans_tagger_export.h"
// test programme to be able using valgrind on the exported part of macaon
using namespace std ;
int main(int argc, char *argv[]) {
if (argc < 4) {
cerr << "usage: " << argv[0] << " <langue> <mcd-file> <mcf-file>" << endl;
return 1;
}
//MacaonTransTagger *mt = new MacaonTransTagger(argv[1], argv[2]);
//MacaonTransLemmatizer *ml = new MacaonTransLemmatizer(argv[1], argv[2]);
MacaonTransParser *mp = new MacaonTransParser(argv[1], argv[2]);
ifstream ifp(argv[3]);
string text;
string line;
while (!ifp.eof()) {
getline(ifp, line);
text += line + "\n";
}
//const char *tags = mt->tagmcf(text.c_str());
//const char *lemmas = ml->lemmatizemcf(tags);
//const char *deps = mp->parsemcf(lemmas);
const char *deps = mp->parsemcf(text.c_str());
cout << deps << endl;
delete mp;
//delete ml;
//delete mt;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment