June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -1,26 +1,25 @@
import system'routines.
import system'calendar.
import system'io.
import system'collections.
import extensions.
import extensions'routines.
import extensions'text.
extension op
{
normalized
= self toArray; ascendant; summarize(String new); literal.
= self toArray; ascendant; summarize(StringWriter new); literal.
}
symbol program =
public program =
[
var aDictionary := Dictionary new.
File new("unixdict.txt"); forEachLine(:aWord)
[
var s := aWord.
var aKey := aWord normalized.
var anItem := aDictionary[aKey].
if ($nil == anItem)
if (nil == anItem)
[
anItem := ArrayList new.
aDictionary[aKey] := anItem.
@ -29,7 +28,7 @@ symbol program =
anItem append:aWord.
].
aDictionary array_list;
aDictionary values;
sort(:aFormer:aLater)( aFormer length > aLater length );
top:20; forEach(:aPair)[ console printLine(aPair value) ].