Skip to content
Snippets Groups Projects
Select Git revision
  • 363c1bdea21fd6cc3afa6c1f653f77a46633dfe7
  • master default protected
  • johannes
  • partial_parser
  • Aloui_Dary
  • ignore_punct
  • AC
  • classifier
  • fixhelp
  • libmacaon2
  • error_predictor
  • morpho
  • ssrnn
  • tfparsing
  • silvio
  • tagger_options
  • maca_trans_frame_parser
  • alexis
  • new_config
  • tagparse
  • maca_graph_parser
21 results

test.cc

Blame
  • test.cc 1.01 KiB
    #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;
    }