Menu

Splitting/Merging AnnotationFiles

Help
2004-08-24
2013-04-09
  • Philip Ogren

    Philip Ogren - 2004-08-24

    Is there any code written for merging or splitting AnnotationFiles?  I have a large file that has been annotated and I want to split both the text file and the annotation file in half so that the two smaller text files both have annotation files.   The two text files with their associated annotation files could then be opened independently. 

    Just thought I would ask in the off chance....

     
    • Thomas Morton

      Thomas Morton - 2004-08-24

      A while ago I wrote some code to append two annotation files together.  It's in: org.annotation.wordfreak.util.Merger.java  As far as I know there isn't anything to split files up.  Hope this helps...Tom

       
    • Thomas Morton

      Thomas Morton - 2004-10-15

      Yesterday I ran into a need for spliting out part of an annotation file into its own file.  Merger now is renamed Adjuster and it now contains both:
      static AnnotationFile split(Annotaiton a)
      static AnnotaitonFile merge(Annotation a, Annotation b)

      Enjoy...Tom

       
      • rsahay

        rsahay - 2008-05-19

        Hi,
        I know this thread is very old but I have few queries about Merging the annotaion file, thats why writing here. First of all I can't create an instance of Annotation class by calling its constructor in Adjuster.java file, I was trying to call following constructor:

        public Annotation(AnnotationTree tree, Span span) {
            init(tree, span, null, null, 0, null);
          }

        I don't know why it is not allowing me to call this constructor here?
        Second thing I was trying to merge two annotation files(.ann files) by calling merge method but it didn't merge the entire annotation into the single annotation file, I am getting the head information but it doesn't give entire annotation in it. Do I need to give extra information? Please suggest..

        Thanks in advance.

        Rsahay.

         
        • Thomas Morton

          Thomas Morton - 2008-05-21

          Hi,

          > First of all I can't create an instance of Annotation class by calling its constructor in Adjuster.java
          > file, I was trying to call following constructor:

          > public Annotation(AnnotationTree tree, Span span) {
          >    init(tree, span, null, null, 0, null);
          > }

          Not sure what you are asking here.  That constructor isn't called in Adjuster (I'm looking at the code in HEAD)  Adjuster calls Annotation.adjustedAnnotation to build the annotation.  It's probably the case that Annotation needs data that is private to it to do this so calling Annotation(AnnotationTree t, Annotation a) directly may not work.

          I'm assuming you are calling Adjuster.merge(Annotation first, Annotation second).  To my knowledge this works.  If it's not working for you can you a case to reproduce what you are seeing. 

          Thanks...Tom

           
    • rsahay

      rsahay - 2008-05-29

      Thanks for your help..
      Yes you are right I was calling Adjuster.merge(Annotation first, Annotation second). But there was problem in my parameters thats why it was not creating the correct result, I corrected my error and its done now..

       

Log in to post a comment.