Ejemplo n.º 1
0
void inputoptions()
{
  /* input the information on the options */
  long i;

  scan_eoln(infile);
  for (i = 0; i < (chars); i++)
      weight[i] = 1;
  if (ancvar)
      inputancestors(anczero0, ancone0);
  if (factors)
      inputfactors(chars, factor, &factors);
  if (weights)
      inputweights(chars, weight, &weights);
  putchar('\n');
  if (weights)
    printweights(stdout, 0, chars, weight, "Characters");
  if (factors)
    printfactors(stdout, chars, factor, "");
  for (i = 0; i < (chars); i++) {
    if (!ancvar) {
      anczero[i] = true;
      ancone[i] = false;
    } else {
      anczero[i] = anczero0[i];
      ancone[i] = ancone0[i];
    }
  }
  if (ancvar)
    printancestors(stdout, anczero, ancone);
  if (!thresh)
    threshold = spp;
  questions = false;
  for (i = 0; i < (chars); i++) {
    questions = (questions || (ancone[i] && anczero[i]));
    threshwt[i] = threshold * weight[i];
  }
}  /* inputoptions */
Ejemplo n.º 2
0
void inputoptions()
{
    /* input the information on the options */
    long i;
    if(justwts) {
        if(firstset) {
            scan_eoln(infile);
            if (ancvar) {
                inputancestors(anczero0, ancone0);
            }
            if (mixture) {
                inputmixture(wagner0);
            }
        }
        for (i = 0; i < (chars); i++)
            weight[i] = 1;
        inputweights(chars, weight, &weights);
        for (i = 0; i < (words); i++) {
            if (mixture)
                wagner[i] = wagner0[i];
            else if (allsokal)
                wagner[i] = 0;
            else
                wagner[i] = (1L << (bits + 1)) - (1L << 1);
        }
    }
    else {
        if (!firstset) {
            samenumsp(&chars, ith);
        }
        scan_eoln(infile);
        for (i = 0; i < (chars); i++)
            weight[i] = 1;
        if (ancvar) {
            inputancestors(anczero0, ancone0);
        }
        if (mixture) {
            inputmixture(wagner0);
        }
        if (weights)
            inputweights(chars, weight, &weights);
        for (i = 0; i < (words); i++) {
            if (mixture)
                wagner[i] = wagner0[i];
            else if (allsokal)
                wagner[i] = 0;
            else
                wagner[i] = (1L << (bits + 1)) - (1L << 1);
        }
    }
    for (i = 0; i < (chars); i++) {
        if (!ancvar) {
            anczero[i] = true;
            ancone[i] = (((1L << (i % bits + 1)) & wagner[i / bits]) != 0);
        } else {
            anczero[i] = anczero0[i];
            ancone[i] = ancone0[i];
        }
    }
    noroot = true;
    questions = false;
    for (i = 0; i < (chars); i++) {
        if (weight[i] > 0) {
            noroot = (noroot && ancone[i] && anczero[i] &&
                      ((((1L << (i % bits + 1)) & wagner[i / bits]) != 0)
                       || threshold <= 2.0));
        }
        questions = (questions || (ancone[i] && anczero[i]));
        threshwt[i] = threshold * weight[i];
    }
}  /* inputoptions */