[asterisk-dev] [asterisk-commits] murf: trunk r89272 - /trunk/main/pbx.c

Steve Murphy murf at digium.com
Tue Nov 20 20:29:08 CST 2007


On Fri, 2007-11-16 at 09:35 -0800, Luigi Rizzo wrote:
> On Fri, Nov 16, 2007 at 10:07:54AM -0700, Steve Murphy wrote:

> > So, my system interprets this by assigning weights to each pattern char,
> > where, right now, N gets 98, Z gets 99, X gets 100, . and ! get 200 (per
> > char matched).
> > A sing char, non pattern, gets '1', and char ranges ( [0123] ), get a
> > count of the number of chars in the range, where the LOWEST score wins.
> 
> I don't understand why N Z X are 98 99 100 instead of 8 9 10 as the
> equivalent [2-9] [1-9] [0-9] ranges ?
> 

This is because, when notation is a mixture of literal chars, and char
ranges, that the raw totals don't always reflect what you would
intuitively think. If a pattern with CID match adds up to around 20
chars, to make the NZX notation stick out, use numbers near 100. That
way, their contribution to the count is hard to lose in the totals. I
will probably also make the [0-9] type range notation have a similar
weight near 100 before I'm finished. 

murf



-- 
Steve Murphy
Software Developer
Digium
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3227 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-dev/attachments/20071120/ea63e43c/attachment.bin 


More information about the asterisk-dev mailing list