add the token_count() scalar function

won't we have to check for collection before?