Expected Response
Token Filters
Trim
Remove trailing and leading whitespace from a token
The trim filter removes leading and trailing whitespace from a token (but not whitespace in the middle). If a token consists
entirely of whitespace, the token is eliminated entirely.
This filter is useful for tokenizers that don’t already split on whitespace, like the literal normalized
tokenizer or certain language-specific tokenizers.
To demonstrate this token filter, let’s compare the output of the following two statements: