Cache Values
This will cache several frequently used calculations and syllable counts of words.
Syllable counts for words are stored globally in an NSCache which will auto-purge should memory become an issue.
Cached values (clean text, letter/word/sentence counts, and average syllables) are only cached once accessed so memory of strings where these values aren't used shouldn't be impacted. They're cached with associated objects so they'll automatically be released when the string is.
Cached values are ignored for mutable strings.
P.S. I totally understand if you don't want to merge this as it can/will increase memory usage. I did, however, get a very noticeable speed boost; esp. when displaying multiple statistics about a block of text.
Sorry for the terrible delay on getting to this. I've been using RNTextStatistics for an idea that involves large bodies of text. However it can be super slow. I'm going to pull in this request to my project and play w/ it to see how a) memory is used and b) if there is a noticeable speed increase.
Really appreciate the work here!