[Zope-dev] Pluggable Indexes and Splitters
Andy Dawkins
andyd@nipltd.com
Tue, 31 Jul 2001 15:41:59 +0000
Chris
Thanks, That makes much more sense.
Still not sure how you could make it work due to previously mentioned
'hardcoding' but the theory sounds spot on.
-Andy
Chris Withers wrote:
>=20
> Andreas Jung wrote:
> >
> > aquires the Splitter from the corresponding Lexicon. Currently
> > there is no official way to make Splitters available only
> > to dedicated components.
>=20
> I think the opposite is true, Splitters and Volcabularies seem to be li=
mited to
> only being used by TextIndexes within PlugginIndexes.
> I just put a bug in the collector about one aspect of this.
>=20
> I think Vocabularies might be generically useful in Zope, not just to Z=
Catalog,
> likewise splitters.
>=20
> I'd love to be able to do:
>=20
> context.mySplitter.split('the qu=EDck brown f0x')
>=20
> ...for example.
>=20
> But, it does seem exraordinarily hard to register new types of splitter.
> Currently, the only way I can think to do it would be something like:
>=20
> import MySplitter
>=20
> from Products.PluginIndexes.TextIndex import Splitter
>=20
> aS =3D Splitter.availableSplitters # why isn't availableSplitters a dic=
tionary?!
> aS =3D aS + ("MySplitter","My Special Funky Splitter")
> Splitter.availableSplitters =3D aS
>=20
> # worse still...
> setattr(Splitter,'MySplitter',MySplitter)
>=20
> ...and I'm not even sure that'd work :(
>=20
> Maybe Vocabularies should be in their own Product and maybe (although m=
aybe not)
> Splitters and Lexicons should be in their own Products too?
>=20
> cheers,
>=20
> Chris
>=20
> _______________________________________________
> Zope-Dev maillist - Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope )