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;
NoneisDEFAULT_ROUTING_POLICY. PassRoutingPolicy()to detect no shapes.
- Returns:
- RoutePlan
- Raises:
- TypeError
If
queryis not a string orpolicyis not aRoutingPolicy.
- Parameters:
query (str)
has_dense (bool)
has_graph (bool)
has_metadata (bool)
policy (RoutingPolicy | None)
- Return type:
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.shapesnames what was detected andplan.unavailablethe 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.jsonpins 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.