static int link_cost(Parse_info pi) { /* computes the cost of the current parse of the current sentence */ /* due to the length of the links */ int lcost, i; lcost = 0; for (i=0; i<pi->N_links; i++) { lcost += cost_for_length(pi->link_array[i].r - pi->link_array[i].l); } return lcost; }
/** * Computes the cost of the current parse of the current sentence, * due to the length of the links. */ static size_t compute_link_cost(Linkage lkg) { size_t lcost, i; lcost = 0; for (i = 0; i < lkg->num_links; i++) { lcost += cost_for_length(lkg->link_array[i].rw - lkg->link_array[i].lw); } return lcost; }