gue sie kompiluje, ale nie dziala: Binary input error (?) To chyba ta stara sprawa ze slownikiem 32/64-bit.
git-svn-id: svn://atos.wmid.amu.edu.pl/utt@42 e293616e-ec6a-49c2-aa92-f4a8b91c5d16
This commit is contained in:
parent
6b3be72395
commit
10c74af18d
@ -27,7 +27,7 @@ export UTT_SHARE_DIR=${UTT_DIR}/share
|
||||
##############################
|
||||
|
||||
# list of components to be included in the distribution
|
||||
COMPONENTS = compiledic cor dgp fla gph grp kon kor kot lem mar rm12 rs12 sen-l sen-nl ser tags tok.l unfla
|
||||
COMPONENTS = compiledic cor dgp fla gph grp gue kon kor kot lem mar rm12 rs12 sen-l sen-nl ser tags tok.l unfla
|
||||
# gue nie dziala!
|
||||
|
||||
##############################
|
||||
|
@ -116,71 +116,160 @@ int main(int argc, char** argv) {
|
||||
unsigned first=1;
|
||||
char* parms_end = parms;
|
||||
char last_lemma[MAX_LINE];
|
||||
|
||||
count = 1;
|
||||
|
||||
while ((i=tab.next()) != -1 && count++<guess_count) {
|
||||
/* if we have "one-line" flag then everything goes in one segment as many fields,
|
||||
* if we have "one-field" flag everything goes in one segment as ONE field:
|
||||
* - diferent lemmas are separated with ';', sequent descriptions to one lemma
|
||||
* are separated with ','
|
||||
*/
|
||||
if ((!first) && (tab[i].w_suf() < cut_off) || (tab[i].w_suf() < delta * last_weight)) {
|
||||
break;
|
||||
}
|
||||
if (first) {
|
||||
parms_end += sprintf(parms_end, "%s", field_prefix);
|
||||
} else if (!args.one_field_flag)
|
||||
parms_end += sprintf(parms_end, "%s", field_prefix);
|
||||
|
||||
if (!args.one_field_flag || strcmp(last_lemma, tab[i].lemma()) != 0) {
|
||||
if (args.one_field_flag && !first)
|
||||
parms_end += sprintf(parms_end, ";");
|
||||
parms_end += sprintf(parms_end, "%s", tab[i].lemma());
|
||||
strcpy(last_lemma, tab[i].lemma());
|
||||
}
|
||||
|
||||
first=0;
|
||||
|
||||
last_weight = tab[i].w_suf();
|
||||
if (!weights)
|
||||
parms_end += sprintf(parms_end, ",%s:%d", tab[i].descr(), (int)tab[i].w_suf());
|
||||
while (count < tab.count() && count <= guess_count)
|
||||
if (first || tab[count].w_suf() >= cut_off && tab[count].w_suf() >= delta * last_weight)
|
||||
{
|
||||
first=0;
|
||||
last_weight = tab[i].w_suf();
|
||||
count++;
|
||||
}
|
||||
else
|
||||
parms_end += sprintf(parms_end, ",%s", tab[i].descr());
|
||||
|
||||
if (!args.one_field_flag) {
|
||||
seg.addfield(parms);
|
||||
parms_end = parms;
|
||||
}
|
||||
|
||||
if (!(args.one_field_flag || args.one_line_flag)) {
|
||||
seg.print(outline);
|
||||
break;
|
||||
|
||||
// drukujemy count pierwszych z tab
|
||||
|
||||
|
||||
if(one_line)
|
||||
{
|
||||
char* descp=desc;
|
||||
for (int i=0; i< count; ++i)
|
||||
{
|
||||
descp += sprintf(descp," %s%s,%s", output_field_prefix, tab[i].lemma(), tab[i].descr());
|
||||
if(weights) descp += sprintf(descp,":%d",(int)tab[i].w_suf());
|
||||
}
|
||||
strcpy(outline,line);
|
||||
outline[strlen(outline)-1]='\0';
|
||||
strcat(outline,desc);
|
||||
strcat(outline,"\n");
|
||||
fputs(outline, outputf);
|
||||
--seg.auxn;
|
||||
if (copy_processed)
|
||||
fputs(line,outputf);
|
||||
}
|
||||
//if (copy_processed)
|
||||
// fputs(outline, stdout);
|
||||
} //while
|
||||
|
||||
if (args.one_field_flag)
|
||||
seg.addfield(parms);
|
||||
|
||||
if (args.one_field_flag || args.one_line_flag){
|
||||
seg.print(outline);
|
||||
fputs(outline, outputf);
|
||||
}
|
||||
} else { // if (process_segment)
|
||||
// jak to nie jest wyraz - to przepisz token na wyjscie.
|
||||
// printtok(line, start, len, cat, form);
|
||||
seg.print(outline);
|
||||
fputs(outline, outputf);
|
||||
if (copy_processed)
|
||||
fputs(outline, stdout);
|
||||
}
|
||||
else if(one_field)
|
||||
{
|
||||
char* descp=desc;
|
||||
for (int i=0; i< count; ++i)
|
||||
if(i==0)
|
||||
{
|
||||
descp += sprintf(descp," %s%s,%s", output_field_prefix, tab[i].lemma(), tab[i].descr());
|
||||
if(weights) descp += sprintf(descp,":%d",(int)tab[i].w_suf());
|
||||
}
|
||||
else
|
||||
{
|
||||
if(strcmp(tab[i].lemma(),tab[i-1].lemma())==0)
|
||||
descp += sprintf(descp,",%s",tab[i].descr());
|
||||
else
|
||||
descp += sprintf(descp,";%s,%s",tab[i].lemma(),tab[i].descr());
|
||||
if(weights) descp += sprintf(descp,":%d",(int)tab[i].w_suf());
|
||||
}
|
||||
|
||||
strcpy(outline,line);
|
||||
outline[strlen(outline)-1]='\0';
|
||||
strcat(outline,desc);
|
||||
strcat(outline,"\n");
|
||||
fputs(outline, outputf);
|
||||
if (copy_processed)
|
||||
fputs(line,outputf);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i=0; i< tab.count(); ++i)
|
||||
{
|
||||
// kolejne opisy - kolejne linie.
|
||||
char* descp=desc;
|
||||
descp += sprintf(desc, " %s%s,%s\n", output_field_prefix, tab[i].lemma(), tab[i].descr());
|
||||
if(weights) descp += sprintf(descp,":%d",(int)tab[i].w_suf());
|
||||
strcpy(outline,line);
|
||||
outline[strlen(outline)-1]='\0';
|
||||
strcat(outline,desc);
|
||||
fputs(outline, outputf);
|
||||
}
|
||||
if (copy_processed)
|
||||
fputs(line,outputf);
|
||||
}
|
||||
}
|
||||
}
|
||||
time_t end_time = time(NULL);
|
||||
if (per_info) {
|
||||
printf("Liczba s³ów: %d\n", words_count);
|
||||
printf("Czas analizy: %d sekund\n", end_time-start_time);
|
||||
}
|
||||
cmdline_parser_free(&args);
|
||||
if(args.interactive_flag)
|
||||
fflush(outputf), fflush(failedf);
|
||||
|
||||
}
|
||||
cmdline_parser_free(&args);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// while ((i=tab.next()) != -1 && count++<guess_count) {
|
||||
// /* if we have "one-line" flag then everything goes in one segment as many fields,
|
||||
// * if we have "one-field" flag everything goes in one segment as ONE field:
|
||||
// * - diferent lemmas are separated with ';', sequent descriptions to one lemma
|
||||
// * are separated with ','
|
||||
// */
|
||||
// if ((!first) && (tab[i].w_suf() < cut_off) || (tab[i].w_suf() < delta * last_weight)) {
|
||||
// break;
|
||||
// }
|
||||
// if (first) {
|
||||
// parms_end += sprintf(parms_end, "%s", output_field_prefix);
|
||||
// } else if (!args.one_field_flag)
|
||||
// parms_end += sprintf(parms_end, "%s", output_field_prefix);
|
||||
|
||||
// if (!args.one_field_flag || strcmp(last_lemma, tab[i].lemma()) != 0) {
|
||||
// if (args.one_field_flag && !first)
|
||||
// parms_end += sprintf(parms_end, ";");
|
||||
// parms_end += sprintf(parms_end, "%s", tab[i].lemma());
|
||||
// strcpy(last_lemma, tab[i].lemma());
|
||||
// }
|
||||
|
||||
// first=0;
|
||||
|
||||
// last_weight = tab[i].w_suf();
|
||||
// if (!weights)
|
||||
// parms_end += sprintf(parms_end, ",%s:%d", tab[i].descr(), (int)tab[i].w_suf());
|
||||
// else
|
||||
// parms_end += sprintf(parms_end, ",%s", tab[i].descr());
|
||||
|
||||
// if (!args.one_field_flag) {
|
||||
// seg.addfield(parms);
|
||||
// parms_end = parms;
|
||||
// }
|
||||
|
||||
// if (!(args.one_field_flag || args.one_line_flag)) {
|
||||
// seg.print(outline);
|
||||
// fputs(outline, outputf);
|
||||
// --seg.auxn;
|
||||
// }
|
||||
// //if (copy_processed)
|
||||
// // fputs(outline, stdout);
|
||||
// } //while
|
||||
|
||||
// if (args.one_field_flag)
|
||||
// seg.addfield(parms);
|
||||
|
||||
// if (args.one_field_flag || args.one_line_flag){
|
||||
// seg.print(outline);
|
||||
// fputs(outline, outputf);
|
||||
// }
|
||||
// } else { // if (process_segment)
|
||||
// // jak to nie jest wyraz - to przepisz token na wyjscie.
|
||||
// // printtok(line, start, len, cat, form);
|
||||
// seg.print(outline);
|
||||
// fputs(outline, outputf);
|
||||
// if (copy_processed)
|
||||
// fputs(outline, stdout);
|
||||
// }
|
||||
// }
|
||||
// time_t end_time = time(NULL);
|
||||
// if (per_info) {
|
||||
// printf("Liczba s³ów: %d\n", words_count);
|
||||
// printf("Czas analizy: %d sekund\n", end_time-start_time);
|
||||
// }
|
||||
// cmdline_parser_free(&args);
|
||||
// }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user