Author: andreas
Date: Sun Mar 20 20:32:03 2005
New Revision: 9819
Modified:
trunk/examples/shootout/wordfreq.dylan
Log:
job: 7045
Convert words to lowercase. This file needs speed optimization.
Modified: trunk/examples/shootout/wordfreq.dylan
==============================================================================
--- trunk/examples/shootout/wordfreq.dylan (original)
+++ trunk/examples/shootout/wordfreq.dylan Sun Mar 20 20:32:03 2005
@@ -3,10 +3,11 @@
use-modules: common-dylan, standard-io, streams, format-out, table-extensions
begin
- let words = make(<case-insensitive-string-table>);
+ let words = make(<string-table>);
while(~stream-at-end?(*standard-input*))
do(method(x)
unless(x = "")
+ x := as-lowercase(x);
let count = element(words, x, default: 0);
words[x] := count + 1;
end unless;
@@ -25,4 +26,4 @@
x.tail > y.tail
end if;
end method));
-end;
\ No newline at end of file
+end;
--
Gd-chatter mailing list
Gd-chatter@xxxxxxxxxxxxxxxx
https://gauss.gwydiondylan.org/mailman/listinfo/gd-chatter
|
|