chronic
chronic copied to clipboard
Stop Token#to_s from modifying word attribute
I wrote a scanner on top of chronic, using its tagger, and this was pretty strange. Token#to_s is elongating its word attribute every time I display it, making it hard to query tokens if they've been tagged.
First commit fixes this bug and includes a testcase. Second commit alters similar mutable-to_s cases throughout the Tag hierarchy to avoid this situation in the future.