linkedin / Spyglass

A library for mentions on Android
Apache License 2.0
387 stars 128 forks source link

No TokenReceiver callback if a special character is followed by explicit char #111

Closed zoubarry closed 3 years ago

zoubarry commented 3 years ago

For example, if we use "@" as explicit char for at mention "@abc" will work as expected to callback on tokenReceiver However, a special char won't work e.g. "@*", no token receiver callback is triggered

nhibner commented 3 years ago

This is expected -- the default tokenizer for mentions does not allow for special characters in the mention, only letters and digits. If your use case requires that, you will need to provide either a custom WordTokenizerConfig or your own implementation of the Tokenizer interface.

In general, Spyglass tries to provide intelligent default behavior that works for as many use cases as possible. When more specific behavior is needed, Spyglass also exposes extension points (via configs and interfaces) to allow for deep customization.