Commit fc0b36e8 authored by Alexis Nasr's avatar Alexis Nasr
Browse files

moved word.c and sentence.c to maca_common changed some file names.

parent e20a7679
......@@ -6,6 +6,8 @@ set(SOURCES src/util.c
src/dico_vec.c
src/feat_types.c
src/form2pos.c
src/word.c
src/sentence.c
)
#compiling library
......
set(SOURCES src/context.c
src/feat_desc.c
src/feature_table.c
src/movement.c
src/movement_parser.c
src/movement_tagger.c
src/sentence.c
src/feat_fct.c
src/feat_vec.c
src/global_feat_vec.c
src/oracle.c
src/oracle_parser.c
src/oracle_tagger.c
src/simple_decoder.c
src/simple_decoder_parser.c
src/simple_decoder_forrest.c
src/simple_decoder_tagger.c
src/cf_file.c
src/feat_lib.c
src/perceptron.c
src/stack.c
src/word.c
src/config2feat_vec.c
src/depset.c
src/feat_model.c
......@@ -31,10 +29,10 @@ add_library(transparse STATIC ${SOURCES})
#compiling, linking and installing executables
add_executable(maca_trans_parser_conll2cff_tagger ./src/maca_trans_parser_conll2cff_tagger.c)
target_link_libraries(maca_trans_parser_conll2cff_tagger transparse)
target_link_libraries(maca_trans_parser_conll2cff_tagger maca_common)
install (TARGETS maca_trans_parser_conll2cff_tagger DESTINATION bin)
add_executable(maca_trans_tagger_conll2cff ./src/maca_trans_tagger_conll2cff.c)
target_link_libraries(maca_trans_tagger_conll2cff transparse)
target_link_libraries(maca_trans_tagger_conll2cff maca_common)
install (TARGETS maca_trans_tagger_conll2cff DESTINATION bin)
add_executable(maca_trans_parser_conll2fann ./src/maca_trans_parser_conll2fann.c)
target_link_libraries(maca_trans_parser_conll2fann transparse)
......@@ -46,7 +44,7 @@ target_link_libraries(maca_trans_parser_conll2cff transparse)
target_link_libraries(maca_trans_parser_conll2cff maca_common)
install (TARGETS maca_trans_parser_conll2cff DESTINATION bin)
add_executable(maca_trans_parser ./src/decode.c)
add_executable(maca_trans_parser ./src/maca_trans_parser.c)
target_link_libraries(maca_trans_parser transparse)
target_link_libraries(maca_trans_parser maca_common)
install (TARGETS maca_trans_parser DESTINATION bin)
......@@ -56,7 +54,7 @@ target_link_libraries(maca_trans_parser_forrest transparse)
target_link_libraries(maca_trans_parser_forrest maca_common)
install (TARGETS maca_trans_parser_forrest DESTINATION bin)
add_executable(maca_trans_tagger ./src/decode_tagger.c)
add_executable(maca_trans_tagger ./src/maca_trans_tagger.c)
target_link_libraries(maca_trans_tagger transparse)
target_link_libraries(maca_trans_tagger maca_common)
install (TARGETS maca_trans_tagger DESTINATION bin)
......
......@@ -3,7 +3,7 @@
#include<string.h>
#include"beam.h"
#include"feat_fct.h"
#include"movement.h"
#include"movement_parser.h"
#include"config2feat_vec.h"
......
......@@ -3,8 +3,8 @@
#include<string.h>
#include<unistd.h>
#include<getopt.h>
#include"movement.h"
#include"oracle.h"
#include"movement_parser.h"
#include"oracle_parser.h"
#include"feature_table.h"
#include"dico.h"
#include"perceptron.h"
......
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include"context.h"
#include"dico.h"
void corpus_fill_all_dico(context *ctx)
{
FILE *f = NULL;
char form[500];
char lemma[500];
char cpos[100];
char pos[100];
char feats[100];
int dep, gov;
char label[100];
int n;
char buffer[10000];
char mvt[100];
int i;
ctx->d_pos = dico_new("d_pos", 10);
dico_add(ctx->d_pos, "NULL");
ctx->d_cpos = dico_new("d_cpos", 10);
dico_add(ctx->d_cpos, "NULL");
ctx->d_feats = dico_new("d_feats", 10);
dico_add(ctx->d_feats, "NULL");
ctx->d_labels = dico_new("d_labels", 10);
dico_add(ctx->d_labels, "NULL");
dico_add(ctx->d_labels, "ROOT");
ctx->d_mvt = dico_new("d_mvt", 10);
dico_add(ctx->d_mvt, "NULL");
f= fopen(ctx->conll_filename, "r");
if(f == NULL){
fprintf(stderr, "cannot open file %s\n", ctx->conll_filename);
exit(1);
}
while(fgets(buffer, 10000, f)){
if(feof(f)) break;
n = sscanf(buffer, "%d\t%s\t%s\t%s\t%s\t%s\t%d\t%s\t_\t_\n", &dep, form, lemma, cpos, pos, feats,&gov, label);
if(n != -1){
dico_add(ctx->d_cpos, cpos);
dico_add(ctx->d_pos, pos);
dico_add(ctx->d_feats, feats);
dico_add(ctx->d_labels, label);
}
}
fclose(f);
/* create the dictionnary for movements */
dico_add(ctx->d_mvt, "S");
for(i=0; i < ctx->d_labels->nbelem; i++){
strcpy(mvt, "R_");
strcat(mvt, ctx->d_labels->array[i]);
dico_add(ctx->d_mvt, mvt);
strcpy(mvt, "L_");
strcat(mvt, ctx->d_labels->array[i]);
dico_add(ctx->d_mvt, mvt);
}
}
#ifndef __CORPUS__
#define __CORPUS__
#include"context.h"
void corpus_fill_all_dico(context *ctx);
#endif
......@@ -4,8 +4,8 @@
#include<unistd.h>
#include<getopt.h>
#include"context.h"
#include"movement.h"
#include"oracle.h"
#include"movement_parser.h"
#include"oracle_parser.h"
#include"feat_fct.h"
#include"feature_table.h"
#include"dico.h"
......
......@@ -5,11 +5,8 @@
#include "feat_types.h"
#include "feat_model.h"
void feat_vec_concat(feat_vec *fv1, feat_vec *fv2)
{
int i;
for(i=0; i < fv2->nb; i++)
if(fv2->t[i] != -1)
......
......@@ -4,13 +4,13 @@
#include<unistd.h>
#include<getopt.h>
#include"context.h"
#include"movement.h"
#include"oracle.h"
#include"movement_parser.h"
#include"oracle_parser.h"
#include"feat_fct.h"
#include"feature_table.h"
#include"dico.h"
#include"beam.h"
#include"simple_decoder.h"
#include"simple_decoder_parser.h"
/*#include"dnn_decoder.h"*/
#include"config2feat_vec.h"
......
......@@ -3,13 +3,12 @@
#include<string.h>
#include<unistd.h>
#include<getopt.h>
#include"movement.h"
#include"oracle.h"
#include"movement_parser.h"
#include"oracle_parser.h"
#include"feat_fct.h"
#include"context.h"
#include"feat_vec.h"
#include"dico_vec.h"
#include"corpus.h"
#include"word_emb.h"
#include"config2feat_vec.h"
......
......@@ -3,13 +3,12 @@
#include<string.h>
#include<unistd.h>
#include<getopt.h>
#include"movement.h"
#include"oracle.h"
#include"movement_parser.h"
#include"oracle_parser.h"
#include"feat_fct.h"
#include"context.h"
#include"feat_vec.h"
#include"dico_vec.h"
#include"corpus.h"
#include"word_emb.h"
#include"config2feat_vec.h"
......
......@@ -9,7 +9,6 @@
#include"context.h"
#include"feat_vec.h"
#include"dico_vec.h"
#include"corpus.h"
#include"word_emb.h"
#include"config2feat_vec.h"
......
......@@ -2,7 +2,7 @@
#include<stdlib.h>
#include<string.h>
#include"util.h"
#include"movement.h"
#include"movement_parser.h"
#if 0
int movement_label(int mvt)
......
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include"oracle.h"
#include"movement.h"
#include"oracle_parser.h"
#include"movement_parser.h"
int check_all_dependents_of_word_in_ref_are_in_hyp(config *c, sentence *ref, int word_index)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment