somewhat silly, but I wanted to try it out with regex
I also borrowed Raul's writedsv
txt=:fread 'c:/temp/const.txt'
('solution.txt';'|';'') writedsv~ |."1 }. \:~ (#;{.)/.~ (#~ 0&= @ {.@{. @
('[a-z]+'&rxmatch)) @ tolower each (rxcut~ ('[();:\s.,]')&rxmatches) txt
I may not have the punctuation list correct
On Wed, Jan 27, 2016 at 3:11 PM, Raul Miller <[email protected]> wrote:
> Ah, I see, yes, I left out the output stage...
>
> I guess if I were to include the writing-to-file stage, I'd probably
> do it something like this:
>
> require'csv web/gethttp'
> const=: gethttp 'http://usconstitution.net/const.txt'
> words=: [: ;: ' '"_`(I.@:= toupper)`]}~@tolower
> ('solution.txt';'|';'') writedsv~ |."1\:~ (<@#/.~,.~.)words const
>
> And I guess I shouldn't be so careless as to leave out steps...
>
> Thanks,
>
> --
> Raul
>
>
> On Wed, Jan 27, 2016 at 3:00 PM, Raul Miller <[email protected]>
> wrote:
> > On Wed, Jan 27, 2016 at 2:34 PM, chris burke <[email protected]>
> wrote:
> >> Note that this solution adheres to the I/O requirements of the
> challenge.
> >
> > I think any solution which downloads the text of the constitution from
> > http://usconstitution.net/const.txt would adhere to those I/O
> > requirements?
> >
> > Thanks,
> >
> > --
> > Raul
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm