mscarey / legislice

API client for fetching and comparing passages from legislation
https://legislice.readthedocs.io/
Other
7 stars 2 forks source link

"start" and "end" params for Enactment select methods #25

Open mscarey opened 3 years ago

mscarey commented 3 years ago

To select text starting or ending in a particular place, without importing TextPositionSelector.

Behind the scenes, the start and end params are converted to a new TextPositionSelector, which is applied along with any other selectors passed to the method.

The params can accept either strings or int indices?

Consider a similar addition to the select_more method.

mscarey commented 3 years ago

Done for Enactment.select, but still needed for Enactment.select_more.

Maybe all the logic for this should be moved to convert_selection_to_set

The resulting selection could be thought of the intersection of the selector defined by start and end, with the other selectors, rather than just as one more selector being added. Generally that would mean the intersection of selecting the whole provision, with the selector defined by start and end. Then the method wouldn't be inexplicably ignoring the "True" selector.