OK, here is a quick hack:
b=: tolower fread '~temp/c.txt'
c=: ;: ' ' (I.b e.'"()[]/;:.,-0123456789',LF)} b
d=: (\:n){(~.c) (,' ',":@]) each n=. #/.~ c
(;d,each '|') fwrite 'solution.txt'
11608
fread 'solution.txt';0 80
the 727|of 495|shall 306|and 264|to 202|be 179|or 160|in 147|states
129|presiden
+/'states' E. b
129
On 26 January 2016 at 14:29, Roger Hui <[email protected]> wrote:
>
> http://kxcommunity.com/kx-student-programming-challenge-us-constitution-word-count.php
>
> J solution, anyone?
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm