Is there a way to implement custom data detectors in NSTextView (like the one that recognizes dates or telephone numbers)?
I think there is an API Reference, but the whole process is not documented. Is there anything that can help me understand what's the right thing to implement?
The LSM is well suited for training/evaluation/categorization of text (think spam filtering). The LSMSmartCategorizer sample code shows how to train and use a LSM map against news feeds.
You can also try to use the NSRegularExpression/NSDataDetector classes (available starting with Lion). They are designed to match on a text input. Once the matches are available, iterate (with a custom block) over the result and perform some highlighting or style modification.
Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With