[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: trouble with order rules in implicit rules

From: Noel Yap
Subject: Re: trouble with order rules in implicit rules
Date: Sun, 09 May 2004 22:27:18 -0400
User-agent: Mozilla Thunderbird 0.5 (Windows/20040212)

Boris Kolpackov wrote:

Noel Yap <address@hidden> writes:
How is "shortest stem" defined?

Literally. Here is the algorithm I have in mind:

1. For each otherwise equally applicable implicit rule extract the
   stem (i.e. what % matched).

2. Find the shortest stem and use corresponding rule.

This would mean that the most "specialized" or "restricted" rule will be used which is what you usually want. For example:



When you try to match "/foo/bar/baz" against those rules the second
one is chosen.

I just found this in my Inbox so I apologize for the late response.

The above algorithm sounds really good.  May I add that, if two patterns 
somehow have equal weighting with the above algorithm, that the one with the 
smallest stem-length-to-pattern-length-ratio should take precedence?

Even without this addition, though, I'm guessing your proposal will catch 99+% 
of the cases.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]