code to pre- and post-process (wiki) text data for statistical chunking