route#

scikitplot.corpus.route(query, *, has_dense=True, has_graph=False, has_metadata=False, policy=None)[source]#

Choose evidence paths by deterministic rule (autonomy level A1).

Parameters:
querystr
has_densebool, optional

Whether a dense index is available.

has_graphbool, optional

Whether a graph view is available.

has_metadatabool, optional

Whether structured metadata filters are available.

policyRoutingPolicy or None, optional

Query-shape rules; None is DEFAULT_ROUTING_POLICY. Pass RoutingPolicy() to detect no shapes.

Returns:
RoutePlan
Raises:
TypeError

If query is not a string or policy is not a RoutingPolicy.

Parameters:
Return type:

RoutePlan

Notes

User. A plain query routes lexical plus dense (plus graph when has_graph), as before. A query with a detected shape – counting, negation, a date, a multi-hop relation, a containment – also gets the paths that shape needs, when the index has them; plan.shapes names what was detected and plan.unavailable the paths that were missing.

Developer. Rule-based, never model-controlled: the guide forbids beginning with a model router, and a deterministic router is also the only kind whose behaviour can be regression-tested; the labelled routing set in tests/data/routing_set.json pins it.

A quoted phrase routes lexical-only and detects no shape, because a caller who quoted a phrase asked for that phrase, not for something semantically nearby.