Hmm.. The code I had posted at http://jsoftware.com/pipermail/programming/2018-April/050900.html almost did what you wanted:
separatedirty ex4 ┌────────────────────┬────────────────────────┬──────────────┬─────────────────────────┐ │This is Skip's test.│Testing one, two, three.│Count 3, 2, 1.│This is abroken sentence.│ └────────────────────┴────────────────────────┴──────────────┴─────────────────────────┘ But you want "a broken" rather than "abroken" here, so: DELIM=:'.?!' toss=:a.#~1-(a.e.DELIM,":i.10)+.(tolower~:toupper) a. separatedirty=:3 :0 (;:'.')-.~(e.&DELIM <@deb;.2 ]) '.',~ ;:inv ::;y ) clean=: tolower@-.&(toss,DELIM) L:0 separateclean=:3 :0 a:-.~(e.&DELIM <@deb;._2 tolower) '.',~(;:inv ::;y) -. toss ) separatedirty ex4 ┌────────────────────┬────────────────────────┬──────────────┬──────────────────────────┐ │This is Skip's test.│Testing one, two, three.│Count 3, 2, 1.│This is a broken sentence.│ └────────────────────┴────────────────────────┴──────────────┴──────────────────────────┘ Good enough? -- Raul On Wed, Apr 4, 2018 at 3:13 PM, Skip Cave <[email protected]> wrote: > All, > > Luckily, the text I am working with is somewhat more well-behaved than > Finnegans Wake or SOLAR BONES. > > However, there is one more twist in the text that I need to address - > broken sentences: > > ex4=. ('This is Skip''s test. Testing one, two, three. Count 3, 2, 1. This > is a');('broken sentence.') > > ex4 > > ┌──────────────────────────────────────────────────────────────────────┬────────────────┐ > > │This is Skip's test. Testing one, two, three. Count 3, 2, 1. This is > a│broken sentence.│ > > └──────────────────────────────────────────────────────────────────────┴────────────────┘ > > Needs to be converted to: > > ex5=. ('this is skips test');('testing one two three');('count 3 2 > 1');'this is a broken sentence' > > ex5 > > ┌──────────────────┬─────────────────────┬───────────┬─────────────────────────┐ > > │this is skips test│testing one two three│count 3 2 1│this is a broken > sentence│ > > └──────────────────┴─────────────────────┴───────────┴─────────────────────────┘ > >> >> >> Skip > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
