[Clam-devel] Re: Patches for python session
David García Garzón
dgarcia at iua.upf.edu
Tue Jul 1 08:30:41 PDT 2008
Commited.
On Tuesday 01 July 2008 07:53:01 JunJun wrote:
> > > > What it is missing:
> > > > - The 'DeeperTag' should be 'Segmentation', see the xml you are
> > > > getting on the unit tests
> > > > - You should move the size attribute from AttributePool to the
> > > > Segmentation element. Be careful as the ScopePool has a different
> > > > 'size' attribute. The one to be moved is the one on AttributePool.
> > >
> > > What about the original size attribute of AttributePool? Below is my
> > > current way to move it:
> > >
> > > ......
> > > line2.attrib.clear()
> > > line2.set('name', attribute)
> > > ........
> > >
> > > If there is any better way to clear a special attribute, please tell
> > > me.
> >
> > This sentence:
> > size = line2.attrib.pop('size')
> > returns the value and removes it from the dict
> >
> > You can see the available methods for a dict in:
> > http://docs.python.org/lib/typesmapping.html
> > or just by doing help( {} )
>
> Thanks! I knew it should be somewhere, and struggled for that *somewhere*.
>
> > > > - We should decide what to do with maxPosisiton and the like. By now
> > > > ignore it until you get the problems. We could provide or compute the
> > > > wave size by command line params.
> > >
> > > OK
> >
> > Some additional points:
> >
> > The same way you set the text you can get it, no need to 'find':
> > anElement.text = anotherElement.text
> >
> > And the name of the outer tag now will not be not 'Segmentations'
> > but 'AttributePool'.
> >
> > <?xml version='1.0' encoding='utf8'?>
> > <DescriptorsPool>
> > <ScopePool name="Song" size="1">
> > <AttributePool name="Silences" size="3">0.1 0.2 0.3</AttributePool>
> > </ScopePool>
> > </DescriptorsPool>
> >
> > Should turn into:
> >
> > <?xml version='1.0' encoding='utf8'?>
> > <DescriptorsPool>
> > <ScopePool name="Song" size="1">
> > <AttributePool name="Silences">
> > <DiscontinuousSegmentation maxlenght="1000" size="3">0.1 0.2
> > 0.3</DiscontinuousSegmentation>
> > </AttributePool>
> > </ScopePool>
> > </DescriptorsPool>
>
> Currently I just set the maxlength to be a fake number.
>
> Although I'm busy during these days, I'll try to spare some time, so
> what're the targets next?
>
> ----- Original Message -----
> From: "David García Garzón" <dgarcia at iua.upf.edu>
> To: "JunJun" <wangjun at dsp.ac.cn>
> Cc: <clam-devel at llistes.projectes.lafarga.org>
> Sent: Sunday, June 29, 2008 2:25 AM
> Subject: Re: Patches for python session
More information about the clam-devel
mailing list