Exemplo n.º 1
0
const string NonProjNivre::get_oracle(
        Configuration& c,
        DependencyTree& tree)
{
    int w1 = c.get_stack(1);
    int w2 = c.get_stack(0);

    int k = c.buffer.empty() ? -1 : c.buffer.back();
    if (w1 > 0
            && tree.get_head(w1) == w2
            && !c.has_other_child(w1, tree))
        return "L(" + tree.get_label(w1) + ")";
    else if (w1 >= 0
            && tree.get_head(w2) == w1
            && !c.has_other_child(w2, tree))
        return "R(" + tree.get_label(w2) + ")";
    else if (w1 < w2 && tree.proj_order[w1] > tree.proj_order[w2] &&
            (k == -1 || tree.mpc[w2] != tree.mpc[k]))
    // else if (w1 < w2 && tree.proj_order[w1] > tree.proj_order[w2])
        return "E";
    else
        return "S";
}