Note that this does not do line-number counting, but instead keeps track of the character position of the token in the input, as required by Lucene's org.apache.lucene.analysis.Token API.