Re: [vwnc] SmallTalk Collection - Update

View: New views
1 Messages — Rating Filter:   Alert me  

Re: [vwnc] SmallTalk Collection - Update

by Steffen Märcker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, a minor update on the matcher is attached. Usage example (with German sugar):

| alphabet values matcher |
values := Dictionary new.
alphabet := #($a $b $c $d $e $f $g $h $i $j $k $l $m $n $o $p $q $r $s $t $u $v $w $x $y $z $ä $ö $ü $ß).
alphabet
        with: (1 to: alphabet size)
        do: [:letter :value | values at: letter put: value].
matcher := DollarMatcher new.
matcher
        dollar: 100;
        string: 'I have found the dollars';
        values: values;
        match

Ok, one last thing. Please consider in usage that the number of matches in a string is approximately 2 power string length - so runtime will be exponential. In the example above it is 22442 - including duplicates.

Ciao, Steffen
_______________________________________________________________________
Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 30 Tage
kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220



_______________________________________________
vwnc mailing list
vwnc@...
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

Dollar Matching.st (6K) Download Attachment
LightInTheBox - Buy quality products at wholesale price!