fix one-off error in computing concordance information

- end of chunk was recognized too early
- assumes that no text can start on the same line as a chunk's end (backed
  by the statement `lines[txts] = ''`)
- clean up code