Skip to contents

Returns the unofficial full text (or a character window of it) of a decision or law, with its metadata. For case law the citation network fields (cases_cited_*, cases_citing_*) come back as list columns when include_citations = TRUE.

Usage

morie_ingest_a2aj_fetch(
  citation,
  doc_type = c("cases", "laws"),
  output_language = c("en", "fr", "both"),
  section = NULL,
  start_char = 0L,
  end_char = -1L,
  include_citations = FALSE,
  citations_limit = 100L,
  citations_offset = 0L,
  timeout = .MORIE_A2AJ_DEFAULT_TIMEOUT,
  user_agent = .MORIE_A2AJ_DEFAULT_UA
)

Arguments

citation

Neutral or official citation, in English or French, for example "2023 SCC 17" or "RSC 1985, c C-46".

doc_type

"cases" (default) or "laws".

output_language

"en" (default), "fr" or "both".

section

Laws only: one section to return instead of the whole text.

start_char, end_char

Character window of the text; end_char = -1 (default) runs to the end. Ignored when section is given.

include_citations

Cases only: also return the lists of cited and citing cases.

citations_limit, citations_offset

Page through those lists (limit at most 1000).

timeout

HTTP timeout in seconds.

user_agent

User-Agent header sent with the request.

Value

A one-row data.frame, or NULL when the citation is not in the corpus. Text is in unofficial_text_en and/or unofficial_text_fr.

Details

A citation the corpus does not hold returns NULL. For a court A2AJ does not cover at all, see morie_ingest_a2aj_gaps and the CanLII client, morie_ingest_canlii_case.

Examples

# \donttest{
doc <- try(morie_ingest_a2aj_fetch("2023 SCC 17", end_char = 400))
if (is.data.frame(doc)) doc$name_en
#> [1] "Canadian Council for Refugees v. Canada (Citizenship and Immigration)"
# }