From: Guido Di M. <gui...@TI...> - 2003-06-04 07:07:50
|
Dear all, I hope you can give a solution to my simple problem ;-) I wrote a xml parser which is able to build an AG througth the AGLIB (using the agfio plug-in). The annotation graph is made of a set of AGId, one for each speaker i= n the parsed file along the transcription. The load method of the agfio plug-in returns a list<AGId>. That's fin= e for me, it works. The problem comes when I have to write to a stream (cout or file outp= ut) the whole graph. How can I build an AGSet from the list<AGId> in order to directly cal= l the toXML(AGSetId id) method ? In the following a piece of code of the demo.cc for my plug-in: =09agfio io; =09map<string,string> signalInfo; =09list<AGId> l =3D io.load("WPC", argv[1], "A1", &signalInfo); =09cout << toXML(*l.begin()) << endl; The last line prints just the first AGId and not the whole graph. How can I get an istance of the AGsetId ? Below I attach a short example of what I'd like to obtain with the "toXML(AGSetId id)" method of AGAPI and that I can actually obtain while building the graph while parsing the original XML transcription (within the SAX Handler). Thanks, Guido Di Maio <?xml version=3D"1.0"?> <!DOCTYPE AGSet SYSTEM "ag.dtd"> <AGSet id=3D"WPC" version=3D"1.0" xmlns=3D"http://www.ldc.upenn.edu/a= tlas/ag/" xmlns:xlink=3D"http://www.w3.org/1999/xlink" xmlns:dc=3D"http://purl.org/DC/documents/rec-dces-19990702.htm"> <Metadata> </Metadata> <Timeline id=3D"WPC:T1"> <Signal id=3D"WPC:T1:1" mimeClass=3D"test_mimeclass" mimeType=3D"test_mimetype" encoding=3D"test_encoding" unit=3D"test_un= it" xlink:type=3D"simple" xlink:href=3D"test_uri" track=3D"test_track"></= Signal> </Timeline> <AG id=3D"WPC:1" timeline=3D"WPC:T1"> <Metadata> <MetadataElement name=3D"Speaker">EST</MetadataElement> </Metadata> <Anchor id=3D"WPC:1:1" offset=3D"0.000000" unit=3D"sec" signals=3D"WPC:T1:1"></Anchor> <Anchor id=3D"WPC:1:2" offset=3D"1.379000" unit=3D"sec" signals=3D"WPC:T1:1"></Anchor> <Anchor id=3D"WPC:1:3" offset=3D"3.536000" unit=3D"sec" signals=3D"WPC:T1:1"></Anchor> <Anchor id=3D"WPC:1:4" offset=3D"4.440000" unit=3D"sec" signals=3D"WPC:T1:1"></Anchor> <Anchor id=3D"WPC:1:5" offset=3D"4.440000" unit=3D"sec" signals=3D"WPC:T1:1"></Anchor> <Anchor id=3D"WPC:1:6" offset=3D"6.381000" unit=3D"sec" signals=3D"WPC:T1:1"></Anchor> <Anchor id=3D"WPC:1:7" offset=3D"6.381000" unit=3D"sec" signals=3D"WPC:T1:1"></Anchor> <Anchor id=3D"WPC:1:8" offset=3D"7.033000" unit=3D"sec" signals=3D"WPC:T1:1"></Anchor> <Anchor id=3D"WPC:1:9" offset=3D"7.936000" unit=3D"sec" signals=3D"WPC:T1:1"></Anchor> <Anchor id=3D"WPC:1:A" offset=3D"9.589000" unit=3D"sec" signals=3D"WPC:T1:1"></Anchor> <Annotation id=3D"WPC:1:E1" type=3D"utterance" start=3D"WPC:1:1" end= =3D"WPC:1:2"> <Feature name=3D"sentence">o vieni / dai //</Feature> </Annotation> <Annotation id=3D"WPC:1:E2" type=3D"turn-EST" start=3D"WPC:1:1" end= =3D"WPC:1:2"> </Annotation> <Annotation id=3D"WPC:1:E3" type=3D"utterance" start=3D"WPC:1:3" end= =3D"WPC:1:4"> <Feature name=3D"sentence">no //</Feature> </Annotation> <Annotation id=3D"WPC:1:E6" type=3D"turn-EST" start=3D"WPC:1:3" end= =3D"WPC:1:8"> </Annotation> <Annotation id=3D"WPC:1:E4" type=3D"utterance" start=3D"WPC:1:5" end= =3D"WPC:1:6"> <Feature name=3D"sentence">ascolta / qui sopra ?</Feature> </Annotation> <Annotation id=3D"WPC:1:E5" type=3D"utterance" start=3D"WPC:1:7" end= =3D"WPC:1:8"> <Feature name=3D"sentence">s=EC //</Feature> </Annotation> <Annotation id=3D"WPC:1:E7" type=3D"utterance" start=3D"WPC:1:9" end= =3D"WPC:1:A"> <Feature name=3D"sentence">sopra <i' piedino> //</Feature> </Annotation> <Annotation id=3D"WPC:1:E8" type=3D"turn-EST" start=3D"WPC:1:9" end= =3D"WPC:1:A"> </Annotation> </AG> <AG id=3D"WPC:2" timeline=3D"WPC:T1"> <Metadata> <MetadataElement name=3D"Speaker">CLA</MetadataElement> </Metadata> <Anchor id=3D"WPC:2:1" offset=3D"1.609000" unit=3D"sec" signals=3D"WPC:T1:1"></Anchor> <Anchor id=3D"WPC:2:2" offset=3D"3.789000" unit=3D"sec" signals=3D"WPC:T1:1"></Anchor> <Anchor id=3D"WPC:2:3" offset=3D"7.033000" unit=3D"sec" signals=3D"WPC:T1:1"></Anchor> <Anchor id=3D"WPC:2:4" offset=3D"7.463000" unit=3D"sec" signals=3D"WPC:T1:1"></Anchor> <Anchor id=3D"WPC:2:5" offset=3D"7.463000" unit=3D"sec" signals=3D"WPC:T1:1"></Anchor> <Anchor id=3D"WPC:2:6" offset=3D"7.936000" unit=3D"sec" signals=3D"WPC:T1:1"></Anchor> <Anchor id=3D"WPC:2:7" offset=3D"8.701000" unit=3D"sec" signals=3D"WPC:T1:1"></Anchor> <Anchor id=3D"WPC:1:A" offset=3D"9.589000" unit=3D"sec" signals=3D"WPC:T1:1"></Anchor> <Anchor id=3D"WPC:2:8" offset=3D"9.851000" unit=3D"sec" signals=3D"WPC:T1:1"></Anchor> <Anchor id=3D"WPC:2:9" offset=3D"9.851000" unit=3D"sec" signals=3D"WPC:T1:1"></Anchor> <Anchor id=3D"WPC:2:A" offset=3D"11.140000" unit=3D"sec" signals=3D"WPC:T1:1"></Anchor> <Annotation id=3D"WPC:2:E1" type=3D"utterance" start=3D"WPC:2:1" end= =3D"WPC:2:2"> <Feature name=3D"sentence">a patire //</Feature> </Annotation> <Annotation id=3D"WPC:2:E2" type=3D"turn-CLA" start=3D"WPC:2:1" end= =3D"WPC:2:2"> </Annotation> <Annotation id=3D"WPC:2:E3" type=3D"utterance" start=3D"WPC:2:3" end= =3D"WPC:2:4"> <Feature name=3D"sentence">qui ?</Feature> </Annotation> <Annotation id=3D"WPC:2:E5" type=3D"turn-CLA" start=3D"WPC:2:3" end= =3D"WPC:2:6"> </Annotation> <Annotation id=3D"WPC:2:E4" type=3D"utterance" start=3D"WPC:2:5" end= =3D"WPC:2:6"> <Feature name=3D"sentence">s=EC //</Feature> </Annotation> <Annotation id=3D"WPC:2:E8" type=3D"turn-CLA" start=3D"WPC:2:7" end= =3D"WPC:1:A"> </Annotation> <Annotation id=3D"WPC:2:E6" type=3D"utterance" start=3D"WPC:2:7" end= =3D"WPC:2:8"> <Feature name=3D"sentence"><s=EC s=EC / vai> //</Feature> </Annotation> <Annotation id=3D"WPC:2:E7" type=3D"utterance" start=3D"WPC:2:9" end= =3D"WPC:2:A"> <Feature name=3D"sentence">aspetta / me lo levo il <calzino> ?<= /Feature> </Annotation> </AG> </AGSet> |