Menu

#17 UnsupportedOperationException in Pronominal Coref

CVS_head
closed-fixed
Core (26)
5
2006-11-29
2006-11-29
jingkei
No

I'm getting an UnsupportedOperationException from the Pronominal Coreferencer.

The pipeline I'm using is:
1) Document Reset PR
2) ANNIE English Tokeniser
3) ANNIE Sentence Splitter
4) ANNIE POS Tagger
5) ANNIE Gazetteer
6) ANNIE OrthoMatcher
7) ANNIE VP Chunker
8) ANNIE Nominal Coreferencer
9) ANNIE Pronominal Coreferencer

When I run it I get this exception:
java.lang.UnsupportedOperationException
at gate.annotation.ImmutableAnnotationSetImpl.clear(ImmutableAnnotationSetImpl.java:69)
at gate.creole.coref.PronominalCoref.preprocess(PronominalCoref.java:673)
at gate.creole.coref.PronominalCoref.execute(PronominalCoref.java:203)
at gate.creole.coref.Coreferencer.execute(Coreferencer.java:107)
at gate.creole.SerialController.runComponent(SerialController.java:177)
at gate.creole.SerialController.execute(SerialController.java:136)
at gate.creole.SerialAnalyserController.execute(SerialAnalyserController.java:67)
at gate.gui.SerialControllerEditor$RunAction$1.run(SerialControllerEditor.java:1230)
at java.lang.Thread.run(Thread.java:595)

I noticed that the get() methods in AnnotationSetImpl.java have recently been updated to return ImmutableAnnotationSets (rev: 7788), which is probably why this hasn't turned up before.

I've included a possible fix.

Discussion

  • jingkei

    jingkei - 2006-11-29

    Diff aganist gate.creole.coref

     
  • jingkei

    jingkei - 2006-11-29
    • milestone: --> CVS_head
     
  • jingkei

    jingkei - 2006-11-29
    • labels: --> Core
     
  • Ian Roberts

    Ian Roberts - 2006-11-29
    • assigned_to: nobody --> ian_roberts
     
  • Ian Roberts

    Ian Roberts - 2006-11-29

    Logged In: YES
    user_id=1157323
    Originator: NO

    You're exactly right - this bug must have been in there for years but it has only just come to light with the change to immutable annotation sets. The correct fix is to change anywhere where the code adds or removes annotations from a subset it obtained by a get() call to add/remove them from the underlying document annotation set directly instead. I'll make the necessary changes.

     
  • Ian Roberts

    Ian Roberts - 2006-11-29
    • status: open --> closed-fixed
     
  • Ian Roberts

    Ian Roberts - 2006-11-29

    Logged In: YES
    user_id=1157323
    Originator: NO

    This should now be fixed as of rev 7868. The process of fixing this turned up one or two other subtle bugs along the way, which I have also fixed.