Opinions

class authorityspoke.opinions.Opinion(position=None, author=None, text=None)

A document that resolves legal issues in a case and posits legal holdings.

Usually an opinion must have position="majority" to create holdings binding on any courts.

Parameters
  • position (Optional[str]) – the opinion’s attitude toward the court’s disposition of the case. e.g. majority, dissenting, concurring, concurring in the result

  • author (Optional[str]) – name of the judge who authored the opinion, if identified

  • text (Optional[str]) –

__post_init__()

Add attributes to store Holdings and Factors keyed to their text selectors.

The holding_anchors are text selectors for the whole Holding, not for any individual Factor. Often select text used to indicate whether the Rule is mandatory, universal, valid, or decided, or show the exclusive way to reach the outputs.

clear_holdings()

Remove all Holdings from the opinion.

explanations_contradiction(other, context=None)

Yield contexts that would result in a contradiction between self and other.

Return type

Iterator[Explanation]

contradicts(other, context=None)

Test whether self implies the absence of other.

Return type

bool

Returns

True if self and other can’t both be true at the same time. Otherwise returns False.

implies(other, context=None)

Test whether self implies other.

Return type

bool

explanations_implication(other, context=None)

Yield contexts that would result in self implying other.

Return type

Iterator[Union[ContextRegister, Explanation]]

property generic_factors_by_name

Get all generic Factors mentioned in self.

Return type

Dict[str, Comparable]

Returns

a list of generic Factor objects mentioned in any input, output, or despite Factor of self, with guaranteed order, including each generic Factor only once.

get_factor_by_name(name)

Search recursively in holdings of self for Factor with name.

Parameters

name (str) – string to match with the name attribute of the Factor being searched for.

Return type

Optional[Factor]

Returns

a Factor with the specified name, if one exists in a Rule in self.holdings. Otherwise None.

get_factor_by_str(query)

Search recursively for Factor in holdings of self.

Return type

Optional[Factor]

posit_holding(holding, holding_anchors=None, named_anchors=None, context=None)

Record that this Opinion endorses specified Holdings.

Return type

None

posit_holdings(holdings, holding_anchors=None, named_anchors=None, context=None)

Add Holdings to this Opinion from a sequence.

Parameters
  • holdings (Union[AnchoredHoldings, Iterable[Union[Holding, Rule]]]) – a sequence of Holdings that this Opinion posits as valid in its own court or jurisdiction, regardless of whether self accepts that the inputs correspond to the reality of the current case, and regardless of whether the court orders that the outputs be put into effect.

  • text_links – mapping of Factors to the Opinion passages where they can be found. Can be obtained as the mentioned return value of one of the functions in authorityspoke.io.readers.

  • context (Optional[Sequence[Factor]]) – an ordered sequence (probably dict) of generic Factor objects from self which will provide the context for the new holding in the present case.

posit(holdings, holding_anchors=None, named_anchors=None, context=None)

Add one or more Holdings to this Opinion.

This method passes its values to posit_holding() or posit_holdings() depending on whether the holding parameter is one Holding or a list.

Parameters
  • holdings (Union[AnchoredHoldings, Holding, Iterable[Union[Holding, Rule]]]) – a Holding that the Opinion self posits as valid in its own court or jurisdiction, regardless of whether self accepts that the inputs of the Holding correspond to the reality of the current case, and regardless of whether the court orders that the outputs of the Holding be put into effect.

  • text_links – list of lists of Opinion passages where references to each Holding can be found.

  • context (Optional[Sequence[Factor]]) – an ordered sequence (probably dict) of generic Factor objects from self which will provide the context for the new holding in the present case.

Return type

None

implied_by(other, context=None)

Test whether other implies self.

Return type

bool

__ge__(other)

Find whether self’s holdings imply all the holdings of other.

Return type

bool

Returns

a bool indicating whether the Rule other (or every holding of other, if other is an Opinion) is implied by some Rule in self.holdings.

__gt__(other)

Find whether self’s holdings imply other’s but self != other.

This actually tests for inequality because Opinion does not have a means method.

Return type

bool

Returns

self >= other and self != other.

select_text(selector)

Get text using a TextQuoteSelector.

Parameters

selector (TextQuoteSelector) – a selector referencing a text passage in this Opinion.

Return type

Optional[str]

Returns

the text referenced by the selector, or None if the text can’t be found.

__str__()

Return str(self).