Fixing a bug in the endsWith method and documenting another bug that it caused with overlapping phrases on the end of strings when emitting single tokens.