Hi Jay,
What you need to do is call the document's toXml() method and pass in
the AnnotationSet that contains the annotations you want to
include. The original annotations will be in an annotation set named
"Original markups" so you will need to use something like:
gate.AnnotationSet aSet = document.getAnnotations("Original markups");
if (aSet != null)
{
String xml = document.toXml(aSet);
...
}
This won't reproduce the input document exactly as GATE will stick
gateID attributes on each annotation.
Keith
At 03:26 AM 9/6/2006, borislav popov wrote:
>Hi Jay,
> There should be a way to preserve the original markup since we use
>the GATE document model underneath. However this is true for some of the
>methods for creation of KIM Document, and not all. We have to check
>which method of creation is used in the population tool and determine
>how the formatting can be preserved.
>Please be patient if we do not answer today, because it is a national
>holiday.
>b
>
>Johnston wrote:
> > When using the Population Tool and the KIM API, I see no way of
> > returning a version of the stored document with original markup. For
> > example, if the source documents are html or xml files,
> > KIMDocument.getContent() returns a plaintext version of the document
> > stripped of all tags. The KIMDocument.toXML() method returns an XML
> > file tagged with annotations and features, but not the original
> > markup. Is there some method I'm missing that will do this or do I
> > need to implement this feature myself?
> >
> > Thanks, Jay
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > NOTE: Please REPLY TO ALL to ensure that your reply reaches all
> members of this mailing list.
> >
> > KIM-discussion mailing list
> > [email protected]
> > http://ontotext.com/mailman/listinfo/kim-discussion_ontotext.com
> >
> > ------------------------------------------------------------------------
> >
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.1.405 / Virus Database: 268.11.7/436 - Release Date: 9/1/2006
> >
>
>_______________________________________________
>NOTE: Please REPLY TO ALL to ensure that your reply reaches all
>members of this mailing list.
>
>KIM-discussion mailing list
>[email protected]
>http://ontotext.com/mailman/listinfo/kim-discussion_ontotext.com
--------------------------------------------------
Research Associate
American National Corpus
[EMAIL PROTECTED]
http://americannationalcorpus.org
_______________________________________________
NOTE: Please REPLY TO ALL to ensure that your reply reaches all members of this
mailing list.
KIM-discussion mailing list
[email protected]
http://ontotext.com/mailman/listinfo/kim-discussion_ontotext.com