Erwerb funktionaler, räumlicher und kausaler Beziehungen von ...

ai.cs.uni.dortmund.de

Erwerb funktionaler, räumlicher und kausaler Beziehungen von ...

Anhang 98

arg_pos = get_next_elem(akt_arg,arg_list,0,',');

while(!(strcmp(akt_arg,"") == 0))

{

p = definition->first;

dbline[0] = '\0';

while(p != 0)

{

if(strcmp(p->var_type,"STRING") == 0)

strcat(dbline,"'");

if (strcmp(p->type,"MOBAL_CLASS") == 0)

strcat(dbline,mobal_class);

if (strcmp(p->type,"PREDICATE_NAME") == 0)

strcat(dbline,akt_pred);

if (strcmp(p->type,"ARGUMENT") == 0)

{

midstr(h,akt_arg,p->start_position,p->end_position);

strcat(dbline,h);

}

if(strcmp(p->var_type,"STRING") == 0)

strcat(dbline,"'");

p=p->next;

if (p != 0)

strcat(dbline,",");

}

write_line(outputfile,dbline);

arg_pos = get_next_elem(akt_arg,arg_list,arg_pos,',');

}

pred_pos = get_next_elem(akt_pred,pred_list,pred_pos,',');

}

return TRUE;

}

/* build_lines liest alle Zeilen der Eingabedatei, und ruft für jede nicht

leere Zeile make_output auf. */

void build_lines(def_list* definition)

{

FILE *inputfile;

FILE *outputfile;

char * buffer;

long count = 0;

buffer = (char *) new_mem(10000,1);

inputfile = open_text_read(definition->input,1);

outputfile = open_text_write(definition->output,1);

while(!(feof(inputfile)))

{

buffer = read_line(inputfile,buffer,10000);

if (buffer != NULL)

{

buffer = trim(buffer,buffer,' ');

if (strcmp(buffer,"") != 0)

{

if (make_output(outputfile, buffer, definition) == 1)

count ++;

}

}

}

fclose(inputfile);

fclose(outputfile);

Weitere Magazine dieses Users
Ähnliche Magazine