#26 error extracting sentence frames

closed-fixed
nobody
None
5
2009-02-16
2005-12-07
juanjof
No

Extracting sentence frames doesn´t work properly. I
suggest 2 changes in class VerbFrame, it seems to work
properly:

1) public static int[] getVerbFrameIndicies(BitSet bits):

indicies[i] = bits.nextSetBit(i == 0 ? 0
:(indicies[i-1]+1));

instead of

indicies[i] = bits.nextSetBit(i == 0 ? 0
:(indicies[i]));

bits.nextSetBit(param) returns the index of the next
bit set to true starting param and including param,
that´s why it always returns the same. Param should be
set to 0 in case of i == 0 and the rest to
indicies[i-1] + 1, because it wants to start from the
last index but without including it.

2) public static String[] getFrames(BitSet bits):

_verbFrames[indicies[i]-1].getFrame();

instead of

_verbFrames[i].getFrame();

In the loop iterarated by i, _verbFrames is indexed
from 0 to indicies.lenght, that´s why indicies is
filled wrongly. It should be indexed with indicies
because it has the indexes, and it must be translated
to the indexes of _verbFrames (indicies[i] - 1).

Discussion

  • Brett Walenz
    Brett Walenz
    2009-02-16

    • status: open --> closed-fixed
     
  • Brett Walenz
    Brett Walenz
    2009-02-16

    This should be fixed now - four years after it was entered. I'm trying to set records here.

    I fully accepted the recommendations left by submitter, thanks for the tips.