Hi Kemal,
 
If you could attach your document, it would be easy to find out the problem. 
 
Niraj
 
----- Original Message -----
From: Fahrettin Oktan
To: gate-discuss@dcs.shef.ac.uk
Sent: Monday, August 22, 2005 9:12 PM
Subject: Re: Re: Using Original Markup in Gate

Hi Niraj,
 
I tried what you suggested but I do not get any results. Here is the code portion that I tried:
 
  AnnotationSet originalAS = doc.getAnnotations("Original markups");
   ArrayList originalTokenList = new ArrayList(originalAS);
  Collections.sort(originalTokenList, new gate.util.OffsetComparator());
  System.out.println("***********Original Markups*************");
  System.out.println("Size: "+originalTokenList.size());
  for (int i=0; i<originalTokenList.size(); i++)
    {
      Annotation origAnnotation = (Annotation)originalTokenList.get(i);

     Iterator origIter=origAnnotation.getFeatures().keySet().iterator();
      while (origIter.hasNext())
      {
    Object key = origIter.next();
    String value = (String) origAnnotation.getFeatures().get(key);
    System.out.println("key: "+(String)key+"\tval: "+value);
   }
   System.out.println();
 
      String tokenType = (String)origAnnotation.getFeatures().get(ANNIEConstants.TOKEN_KIND_FEATURE_NAME+"");
   String word = (String)origAnnotation.getFeatures().get(ANNIEConstants.TOKEN_STRING_FEATURE_NAME);
   System.out.print(tokenType+"\t"+word);
  }
 
 
And here is the result:

***********Original Markups*************
Size: 1
null null
 
So, it returns only one element in the resulting annotation and the values are null. Am I doing something wrong?
 
By the way, when I am adding the document to corpus, I have this:
doc.setMarkupAware(new Boolean(true));
 
Thanks,
Kemal
 
--------
From: Niraj Aswani <n.aswani_at_dcs.shef.ac.uk>
Date: Tue Aug 16 2005 - 12:07:32 BST
X-Mailer: Microsoft Outlook Express 6.00.2900.2180

Hi Kemal,

I just tried running Goldfish program myself (without any change) and everything seems to work correctly.

You don't need to do anything for GATE to generate original markups as annotaions. When you load your document in GATE, it is processed by the GATE and original markups are stored as annotations under the "Original markups" annotationSet.

So to be specific:
============
Once the document is loaded, if you want to access the original markups as annotations, use:
AnnotationSet originalAS = doc.getAnnotations("Original markups");

and if you want to access the annotations created by GoldfishPR, use the following statement:
AnnotationSet goldFishAS = doc.getAnnotations();

HTH,
Niraj


Start your day with Yahoo! - make it your home page