query_tokens#

scikitplot.corpus.query_tokens(query)[source]#

Return the words a routing rule matches against.

Parameters:
querystr

The query text.

Returns:
tuple of str

Lowercase [a-z0-9]+('[a-z]+)? tokens, in order.

Raises:
TypeError

If query is not a string.

Parameters:

query (str)

Return type:

tuple[str, …]

Examples

>>> query_tokens("Isn't it in Section 2?")
("isn't", 'it', 'in', 'section', '2')