[Zope-dev] stemmed and stopped: problems with stopwords and the 'and' operator

2000-08-17 Thread R. David Murray

OK, so the TextIndex of a ZCatalog says that it "stems and stops" the
words before indexing them and, one would hope, before searching
for them.

I always thought that "stem" meant "derive the stem of the word" (so
as to make the index smaller).  I just peeked at the Splitter.c
source code for the first time, and that sure ain't it.  The American
phrase would be "truncate and stop", I think.  In any case, "stem"
in the source code comments means truncate at MAX_WORD, which is
64 characters.

That's an aside.

Now, about stopping.  There is a list of "stop words" that don't
get indexed.  Fine.  I'm having quite a bit of trouble figuring
out exactly where this is happening, but let's ignore that
for now on the indexing side.  It happens, that's enough for now.

Now, what happens to stop words in an input search string?
From my single stepping the code, stopwords are still in
the query string while it is being parsed, and get looked
up in the index.

So, here is the heart of my problem:  consider the search string

  someword and someotherword

Suppose 'someword' is a stopword.  It doesn't get indexed because
it is considered too common.  Now, I would think that if this
search string is submitted, the result would be to return the
hits for 'someotherword'.  This might, however, not be other
people's opinions.  So, is the fact that TextIndex appears to
return the null set in this case a bug or a feature?

I say 'appears' because I actually get 2 (out of about 2000 with
the keyword 'car') hits in my database when I search on 'car and
the'.  I tried to single step through the logic using the debugger,
but when the call is made made to the splitter with the stopword
passed in, python core dumps.  I can do 'from SearchIndex.Splitter
import Splitter', and call Splitter, and see that stopwords are
not removed, but I can't do 'from SearchIndex.UnTextIndex import
Splitter' because it complains about not being able to import
Persistent from Persistence.  (*That* problem was reported by someone
else in another context not too long ago.)

However, it's pretty clear that this null set return is what is
happening, since when the evaluate subroutine is entered, the stop
word is in the partially parsed string, and is in fact passed to
the Splitter in the __getitem__ of the text index.  If the splitter
stopped it, the returned result set would be None, If the splitter
doesn't stop it, the text index is still going return a null set
as the result for that word, since it doesn't appear in the index
by definition.  An 'and' of any result set with None is going to
be the null set.

So it looks like the thing was designed this way:  the stop words
get "deleted" from the search string by not being in the index and
by therefore returning null sets when looked up.  This works fine for
'or' logic, but not for 'and' logic, IMO.

Contrary opinions?  Helpful hints?  If I'm right and this needs
fixed, it's going to be a bit of a bear to do, I think.

(Where those two hits are coming from is a *real* mystery, but one
I'm going to ignore for a little while yet since I can't yet get
the debugger to work for me without crashing.  I have a sneaking
suspicion it is related to my confusion about where stopwords
get removed in the indexing process, but it will probably take
a while for me to prove or disprove that notion.)

--RDM


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope-dev] Caching problems

2000-08-17 Thread Bob Pepin

On Wed, Aug 16, 2000 at 05:31:29PM +0100, Carlos Neves wrote:
 You directly change a nonpersistence participant object.
 As stated in
 http://www.python.org/workshops/2000-01/proceedings/papers/fulton/zodb3.html :
[...]
 but mainly... RTFM ;-)

Well, thanks, but too bad the only FM I've been able to find about Zope are
those .py files in lib/python/...

I spent a whole day looking for documentation on ZODB internals on zope.org and
zdp.zope.org, without being able to find anything... how about adding that
paper to the search engine on zope.org? Is there more documentation like that
one out there?

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )




[Zope-dev] Acquisition ( slightly less Confusion ;-)

2000-08-17 Thread Chris Withers

Evan Simpson wrote:
   - never expose a "bare" object, or even one with an incomplete context
 
  Why? You can get at it through aq_base anyway, surely?
 
 Only from unrestricted code.  DTML and (CVS) Python Methods only let you
 access aq_parent.  This only applies to objects that are part of the
 containment hierachy, of course.  Brand new objects aren't wrapped, nor are
 simple non-persistent types like lists and dicts.

Ah, okay... so really, prettymuch all Zope objects should be wrapped
with only one or two exceptions, most of which aren't actually objects
as such but simple data types?


  Would it matter if the
  wrappers were structured differently to provide a different search
  order?

 Only to anyone who depends on the current behavior :-) 

Heh, ain't backward compatability a bitch ;-)

 Also, there is a
 very limited range of "natural" ways to construct the wrappers.  Once
 contructed, of course, we can fool with them in arbitrary ways.

So I see, does this reduce efficiency at all?

 We want to be able to find out what an object's container is, regardless of
 what we acquired it from.  In raw acquisition, there's no straightforward
 way to do this.  In simplified acquisition, aq_inner.aq_parent is the
 container.  The simplification is the rule (A o B) o (B o C) = A o (B o C).

I don't see how this simplification actually makes a difference...
In what way does it change the search order?
From what I read, I though it just reduced the number of checks you had
to do...

 All of these would search the dotted expression from right to left, so they
 would give you B's I.
  dtml-var expr="aq_context(A.B.C.D).I"
  dtml-var expr="aq_context(A.B.C).I"
  dtml-var expr="aq_context(A.B).I"

cool :-)

 All of these would search the containers of the right-most object, so the
 first two would give you A's I, and the third B's I.
  dtml-var expr="aq_containment(A.B.C.D).I"
  dtml-var expr="aq_containment(A.B.C).I"
  dtml-var expr="aq_containment(A.B).I"

weird ;-S (but I suppose someone might find it useful ;-)

The external methods were very cool. How should I got about petitioning
for 
dtml-var anobject aq_context to become valid syntax?

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope-dev] Acquisition ( slightly less Confusion ;-)

2000-08-17 Thread Shane Hathaway

Chris Withers wrote:
 How should I got about petitioning
 for
 dtml-var anobject aq_context to become valid syntax?

There's one little (okay, big) problem with this idea: aq_context
strips the security context.  In fact, it could be used to confuse the
security machinery.

Let's say I'm Joe Hacker and I have set up membership at
www.zope.org/Members/jhacker.  I create a DTML method called index_html
with this:

dtml-with Members
dtml-with hathawsh aq_context
  dtml-call expr="index_html.manage_edit('1 0WN U')"
/dtml-with
/dtml-with

Line 2 might be written as dtml-with hathawshdtml-with aq_context.

Now I may have accessed the member folder for hathawsh with the local
roles that are supposed to be in effect only in my own folder.  Zope
acquires the local roles from anything in the path
/Members/jhacker/Members/hathawsh/index_html.  Normally the local roles
would be determined by /Members/hathawsh/index_html, in which case Zope
would find no local roles for jhacker.

"aq_containment" should be fine, however.

Shane

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )




[Zope-dev] Comparing folder instances

2000-08-17 Thread Carl Robitaille

Hi,

A quick question. How do I compare folder instances ?(or any instances
as a matter of fact).

Here is a simple code showing what I tried:

dtml-in "objectValues(['Folder'])"

 dtml-var "_.getitem('sequence-item')"
 dtml-var "images"
 dtml-var "_.getitem('sequence-item')==images"

/dtml-in

Here is now the resulting HTML


Folder instance at 85cf958
Folder instance at 85cf958
0


Folder instance at 858a168
Folder instance at 85cf958
0

Why isn't the first comparison returning true? What I want to use is
something like:


dtml-in "objectValues(['Folder'])"

 dtml-if "_.getitem('sequence-item')==images"
   EQUAL
 dtml-else
   NOT EQUAL
 /dtml-if

/dtml-in

Thanks a lot in advance for your comments.

Carl

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )




[Zope-dev] Acquisition Wrappers Bit Again ;-)

2000-08-17 Thread Chris Withers

Carl Robitaille wrote:
  dtml-var "_.getitem('sequence-item')"
  dtml-var "images"
  dtml-var "_.getitem('sequence-item')==images"

 Folder instance at 85cf958
 Folder instance at 85cf958

Congratulations, you've just been bitten by the thing that confused me
for half a day...
You see, while they say Folder instance at 85cf958, they're actually
lying ;-)

The objects you're comparing are actually acquisition wrappers.

IMHO, == should work with acquisition to make problems like the above
not happen. I suggested this, and Jim Fulton agreed:
http://zope.nipltd.com/public/lists/dev-archive.nsf/ByKey/08240A8E0D50AEE0 

Sadly, nothing seems to have been done about it :(
Maybe you should chuck it in the collector as a bug in the
ExtensionClass?

cheers,

Chris

PS: In the meantime, the following should work:

 dtml-in "objectValues(['Folder'])"
 
  dtml-if
"_.getattr(_.getitem('sequence-item'),'aq_base',_.getitem('sequence-item'))==_.getattr(images,'aq_base',images)"
EQUAL
  dtml-else
NOT EQUAL
  /dtml-if
 
 /dtml-in

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )




[Zope-dev] Re: Acquisition Wrappers Bit Again ;-)

2000-08-17 Thread Carl Robitaille

Hi Criss,
 
Thanks a lot for your quick response!! Since I'm a new Zope user, I
guess I'll just cut-paste the line you suggest without trying to
understand for the moment  ;-)

Carl


 Carl Robitaille wrote:
   dtml-var "_.getitem('sequence-item')"
   dtml-var "images"
   dtml-var "_.getitem('sequence-item')==images"
 
  Folder instance at 85cf958
  Folder instance at 85cf958
 
 Congratulations, you've just been bitten by the thing that confused me
 for half a day...
 You see, while they say Folder instance at 85cf958, they're actually
 lying ;-)
 
 The objects you're comparing are actually acquisition wrappers.
 
 IMHO, == should work with acquisition to make problems like the above
 not happen. I suggested this, and Jim Fulton agreed:
 http://zope.nipltd.com/public/lists/dev-archive.nsf/ByKey/08240A8E0D50AEE0
 
 Sadly, nothing seems to have been done about it :(
 Maybe you should chuck it in the collector as a bug in the
 ExtensionClass?
 
 cheers,
 
 Chris
 
 PS: In the meantime, the following should work:
 
  dtml-in "objectValues(['Folder'])"
 
   dtml-if
 
"_.getattr(_.getitem('sequence-item'),'aq_base',_.getitem('sequence-item'))==_.getattr(images,'aq_base',images)"
 EQUAL
   dtml-else
 NOT EQUAL
   /dtml-if
 
  /dtml-in

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )




[Zope-dev] Re: Acquisition Wrappers Bit Again ;-)

2000-08-17 Thread Chris Withers

Carl Robitaille wrote:
 Hi Criss,
 
 Thanks a lot for your quick response!! Since I'm a new Zope user, I
 guess I'll just cut-paste the line you suggest without trying to
 understand for the moment  ;-)

Nih!

Welcome to the deep end ;-)

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )




[Zope-dev] Cool, we like the . :-)

2000-08-17 Thread Chris Withers


Steve Alexander wrote:
 I can't think of a nice alternative to mean dtml-/foo/bar/baz; "from
 the root, traverse as follows".

dtml-.foo.bar.baz;

not nice, btu I can't think of anything better :(

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )




[Zope-dev] Extending dtml entity syntax

2000-08-17 Thread Steve Alexander

Chris Withers has suggested extending the DTML Entity syntax to include
traversal information.

For example: dtml-foo/bar/baz;

I just checked the XML standard. This isn't allowed in XML entities.

  http://www.w3.org/TR/1998/REC-xml-19980210#NT-Nmtoken

  EntityRef ::= '' Name ';'

  NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar
   | Extender
  
  Name ::= (Letter | '_' | ':') (NameChar)*

However, we could consider dtml-foo.bar.baz; instead.

I can't think of a nice alternative to mean dtml-/foo/bar/baz; "from
the root, traverse as follows".

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )




[Zope-dev] Re: Acquisition Wrappers Bit Again ;-)

2000-08-17 Thread Carl Robitaille

Hi,

Just for the record, Criss' suggestion didn't work for me. I don't
quite get why though Here's the code again, where images is a
Folder:


 dtml-in "objectValues(['Folder'])"
 
  dtml-if
"_.getattr(_.getitem('sequence-item'),'aq_base',_.getitem('sequence-item'))==_.getattr(images,'aq_base',images)"
EQUAL
  dtml-else
NOT EQUAL
  /dtml-if
 
 /dtml-in

The error I get from Zope is:

File /home/zope/Zope2/lib/python/DocumentTemplate/DT_Util.py, line 337,
in eval
  (Object:
_.getattr(_.getitem('sequence-item'),'aq_base',_.getitem('sequence-item'))==_.getattr(images,'aq_base',images))
  (Info: images)
File string, line 0, in ?
File /home/zope/Zope2/lib/python/DocumentTemplate/DT_Util.py, line 140,
in careful_getattr
AttributeError: aq_base

It's looks like aq_base is not available. I read Shane's Acquisition
Understander How-To. I created the ExternalMethod that used aq_base and
it works like a charm. I tried a lot of things even if I didn't have a
good undersanding of the problem. The only time I got a valid code (Zope
not complaining when hitting the Change button) was with that line:

  dtml-if
"_.getattr(_.getitem('sequence-item'),'images.aq_base',_.getitem('sequence-item'))==_.getattr(images,'images.aq_base',images)"

You probably know why it doesn't give the right result, but I don't
have a clue. It's still not returning true when sequence-item is
matching the images Folder. Is there anything I can read to understand
what I'm dealing with? Or maybe somebody knows what I'm doing wrong...
again


Carl


 Carl Robitaille wrote:
  Hi Criss,
 
  Thanks a lot for your quick response!! Since I'm a new Zope user, I
  guess I'll just cut-paste the line you suggest without trying to
  understand for the moment  ;-)
 
 Nih!
 
 Welcome to the deep end ;-)
 
 cheers,
 
 Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope-dev] Aaargh, no safe seperators :S

2000-08-17 Thread Phil Harris

-, that;s a hyphen to you
- Original Message - 
From: "Chris Withers" [EMAIL PROTECTED]
To: "Shane Hathaway" [EMAIL PROTECTED]
Cc: "Jonothan Farr" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, August 17, 2000 9:57 PM
Subject: [Zope-dev] Aaargh, no safe seperators :S


 Shane Hathaway wrote:
  That would probably work, but isn't kind of ugly?  Now we'd be forcing
  people to realize that colons can be path separators.  Only Mac users
  know this. :-)
 
 Well, 
 
   / and \ are bad XML
 
   ; is bad XML, and _really_ ugly
 
   . confuses when there's .'s in ids
 
 Any other suggestions :S
 
 cheers,
 
 Chris
 
 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 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 )


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )




[Zope-dev] Aaargh, no safe seperators :S

2000-08-17 Thread Chris Withers

Shane Hathaway wrote:
 That would probably work, but isn't kind of ugly?  Now we'd be forcing
 people to realize that colons can be path separators.  Only Mac users
 know this. :-)

Well, 

  / and \ are bad XML

  ; is bad XML, and _really_ ugly

  . confuses when there's .'s in ids

Any other suggestions :S

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )




[Zope-dev] patch for dtml-foo:bar:baz;

2000-08-17 Thread Steve Alexander

This patch changes lib/python/DocumentTemplate/DT_HTML.py so that you
can use paths for traversal in DTML entity syntax. The delimiter is ':',
as it is valid as part of an XML entity, but not valid as part of a Zope
object id.

You can use dtml-:foo:bar; to ensure that traversal occurs from the
root object.

This patch is against Zope 2.2.1b1. It relies on the
restrictedTraverse() api.

A 2.1.x version would be possible, but would be rather messy.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net

*** DT_HTML.py.old
--- DT_HTML.py
***
*** 98,104 
 end_match=regex.compile('[\0- ]*\(/\|end\)',
 regex.casefold).match,
 start_search=regex.compile('[]').search,
!ent_name=regex.compile('[-a-zA-Z0-9_.]+').match,
 find=find,
 strip=strip,
 replace=replace,
--- 98,104 
 end_match=regex.compile('[\0- ]*\(/\|end\)',
 regex.casefold).match,
 start_search=regex.compile('[]').search,
!ent_name=regex.compile('[-a-zA-Z0-9_.:]+').match,
 find=find,
 strip=strip,
 replace=replace,
***
*** 156,162 
  d[1]=d['end']=''
  d[2]=d['name']='var'
  d[0]=text[s:e+1]
! d[3]=d['args']=args+' html_quote'
  return s
  else:
  nn=find(args,'-')
--- 156,165 
  d[1]=d['end']=''
  d[2]=d['name']='var'
  d[0]=text[s:e+1]
! d[3]=d['args']=':' in args \
! and '"_.render(restrictedTraverse(\''+ \
! replace(args,':','/')+'\'))" html_quote' \
! or args+' html_quote'
  return s
  else:
  nn=find(args,'-')
***
*** 164,171 
  d[1]=d['end']=''
  d[2]=d['name']='var'
  d[0]=text[s:e+1]
! args=(args[nn+1:]+' '+
!   replace(args[:nn],'.',' '))
  d[3]=d['args']=args
  return s
  
--- 167,178 
  d[1]=d['end']=''
  d[2]=d['name']='var'
  d[0]=text[s:e+1]
! path=args[nn+1:]
! args=(':' in path 
! and  '"_.render(restrictedTraverse(\''+
! replace(path,':','/')+'\'))" ' 
! or path+' ') \
! +replace(args[:nn],'.',' ')
  d[3]=d['args']=args
  return s
  



Re: [Zope-dev] Aaargh, no safe seperators :S

2000-08-17 Thread Chris Withers

Phil Harris wrote:
 
 -, that;s a hyphen to you

and that can appear in ids ;-)

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope-dev] Aaargh, no safe seperators :S

2000-08-17 Thread Phil Harris

How about 

as in

dtml-pathtofileobjectwotsit;

nah, looks really ugl




- Original Message -
From: "Chris Withers" [EMAIL PROTECTED]
To: "Phil Harris" [EMAIL PROTECTED]
Cc: "Shane Hathaway" [EMAIL PROTECTED]; "Jonothan Farr" [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Thursday, August 17, 2000 10:27 PM
Subject: Re: [Zope-dev] Aaargh, no safe seperators :S


 Phil Harris wrote:
 
  -, that;s a hyphen to you

 and that can appear in ids ;-)

 cheers,

 Chris


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )




[Zope-dev] Still no safe seperators :P

2000-08-17 Thread Chris Withers

Phil Harris wrote:
 
 How about 
 
 as in
 
 dtml-pathtofileobjectwotsit;
 
 nah, looks really ugl

And I'm damn sure that's bad XML ;-)

Looks like the colon it is then, there's even a patch now ;-)

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )




[Zope-dev] Re: Acquisition ( slightly less Confusion ;-)

2000-08-17 Thread Evan Simpson

From: Chris Withers [EMAIL PROTECTED]
 Ah, okay... so really, prettymuch all Zope objects should be wrapped
 with only one or two exceptions, most of which aren't actually objects
 as such but simple data types?

Yes.

  Also, there is a
  very limited range of "natural" ways to construct the wrappers.  Once
  contructed, of course, we can fool with them in arbitrary ways.

 So I see, does this reduce efficiency at all?

Sure, but the question is, does it reduce efficiency *unacceptably*, and I
can't answer that.

  container.  The simplification is the rule (A o B) o (B o C) = A o (B o
C).

 I don't see how this simplification actually makes a difference...

In the next step, if we ask for a D and it's found in B, we get:

(A o (B o C)).D = (B o C).D o (A o (B o C)) = ((D o B) o (B o C)) o (A o
(B o C)) = (D o (B o C)) o (A o (B o C))

instead of

((A o B) o (B o C)).D = (A o B).D o ((A o B) o (B o C)) = ((D o B) o (A o
B)) o ((A o B) o (B o C))

The search order with simplification is D, B, C, A (containment first),
while without it's D, B, A, C (just plain weird).

Cheers,

Evan @ digicool  4-am


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope-dev] Data.fs

2000-08-17 Thread R. David Murray

On Thu, 17 Aug 2000, Andre Schubert wrote:
 My Questions are: is there a way to delete the last transaction from

One answer: use tranalyzer to find the offset of the start of the
last transaction and truncate the file there.

 Data.fs, and can i backup the Data.fs when Zope is running. Is the

Yes.

 backup of Data.fs inconsitent when i make the backup at the same time a
 user writes to it?

No.  If the last transaction in Data.fs s incomplete, Zope will ignore it on
startup.

--RDM


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope-dev] stemmed and stopped: problems with stopwords andthe 'and' operator

2000-08-17 Thread R. David Murray

On Thu, 17 Aug 2000, Martijn Pieters wrote:
 No clues as to where you'll find the stopword code, but the Persistence
 thingy is caused by the magic that ZODB performs: it initializes the
 correct Persistence module when it itself is imported. This way Jim
 managed to have ZODB3 and BoboPOS2 exist in the same Zope distribution.
 
 Do an import ZODB before you do your Splitter import, and all will be
 dandy.

Thanks, worked like a charm.

I think I've found the stopword code.  To cement my understanding
I'm going to write this up.  Maybe somebody will find it useful grin.

UnTextIndex accesses the splitter through the Splitter method of the
Lexicon associated with the index.  That Lexicon instance is created
when the Vocabulary or Catalog are created.  (Comments in the code
indicate that in the future each TextIndex could have its own Lexicon,
which makes sense to me.)  A Lexicon instance can be passed a list
of stop words (and/or synonyms) when it is initialized.  Vocabulary
does this for Lexicon (but not GlobbingLexicon, which internal
comments indicates does not use stopwords).  The Lexicon instance
stores this list in a property, and passes it to the real Splitter
when its Splitter method is called.

So the fix that I submitted earlier today to the collector for the 'and'
involving stopwords should work for 'listed' stopwords as well as
the punctuation and numbers that I was able to test it on.  (In my
comments in the patch I said I wasn't sure).  I still can't test it
because I'm using a Globbing lexicon wry grin.

In perusing the code I'm also feeling more confident that the
change I made to __getitem__ in that fix is in fact semantically
correct.  Or at least consistent with the rest of the __getitem__ code.

GlobbingLexicon not using stopwords also explains the few hits
on 'the and car' that I got that I was confused by.  Those entries
really must have 'the' as an indexed term, unlike the rest.

Oh, by the way, the comments in TextIndex seem to agree with me
as to the conventional meaning of the word 'stemmed' grin.

--RDM


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope-dev] Still no safe seperators :P

2000-08-17 Thread Evan Simpson

From: "Chris Withers" [EMAIL PROTECTED]
 Looks like the colon it is then, there's even a patch now ;-)

There a patch sitting around waiting for DTML syntaxgeddon which allows
slash-separated paths in object names everywhere, not just in entity syntax.
That could easily be extended to also allow colons as separators.

Cheers,

Evan @ 4-am  digicool


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
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 )