# CS-Muni profile registry
#
# Generated by schema/derive_profiles.py from the corpus scan. A CS-Muni document names
# one entry from each registry in its <muni:profile> element; the converter and the
# renderer read the declaration rather than assuming a house style.
#
# The candidate ladders and grammars are curated; the support counts are measured.
# `states` records the dominant profile per state and is a starting point for onboarding
# a new community, not a substitute for checking that community's own code.

generated_by: schema/derive_profiles.py
evidence:
  codes: 738
  states: 25
  source: survey/corpus.jsonl
citation_grammars:
  chapter-section:
    pattern: "^(?P<chapter>\\d+[A-Z]?)-(?P<section>\\d+(?:\\.\\d+)?)$"
    example: "1-14"
    eid: "sec_{chapter}-{section}"
    codes: 457
    share: 0.619
  dotted-decimal:
    pattern: "^(?P<title>\\d+)\\.(?P<chapter>\\d+)\\.(?P<section>\\d+)$"
    example: "14.05.030"
    eid: "sec_{title}.{chapter}.{section}"
    codes: 225
    share: 0.305
  chapter-article-section:
    pattern: "^(?P<chapter>\\d+)-(?P<article>\\d+)\\.(?P<section>\\d+)$"
    example: "240-4.5"
    eid: "sec_{chapter}-{article}.{section}"
    codes: 28
    share: 0.038
  dashed-triple:
    pattern: "^(?P<title>\\d+)-(?P<chapter>\\d+)-(?P<section>\\d+)$"
    example: "1-04-010"
    eid: "sec_{title}-{chapter}-{section}"
    codes: 15
    share: 0.02
  flat:
    pattern: "^(?P<section>\\d+)$"
    example: "112"
    eid: "sec_{section}"
    codes: 8
    share: 0.011
  alpha-chapter-section:
    pattern: "^(?P<chapter>[A-Z]+\\d*)-(?P<section>\\d+(?:-\\d+)?)$"
    example: A676-3
    eid: "sec_{chapter}-{section}"
    codes: 1
    share: 0.001
  article-section:
    pattern: "^(?P<article>\\d+)\\.(?P<section>\\d+)$"
    example: "4.5"
    eid: "sec_{article}.{section}"
    note: "Two-part decimal, article then section. Not a codifier house style: it is what a city typesets when it publishes its zoning as a standalone book. Lowell."
    codes: 0
    share: 0.0
enumeration_ladders:
  eastern-bracket:
    rungs:
      - A.
      - (1)
      - (a)
      - "[1]"
      - "[a]"
      - "[i]"
      - "[A]"
    elements:
      - subsection
      - paragraph
      - subparagraph
      - point
      - indent
      - clause
      - subclause
    note: "General Code's eastern house style. New England, the mid-Atlantic and the Great Lakes. Sherborn uses the first four rungs."
    codes: 424
    share: 0.575
  western-alpha:
    rungs:
      - A.
      - "1."
      - a.
      - i.
      - (A)
      - (1)
    elements:
      - subsection
      - paragraph
      - subparagraph
      - point
      - indent
      - clause
    note: "The western house style: capital letter, then arabic, then lower alpha, then lower roman. California, Arizona, Colorado, Alaska, Idaho, Kansas."
    codes: 210
    share: 0.285
  parenthetical-lower:
    rungs:
      - (a)
      - (1)
      - (A)
      - (i)
    elements:
      - subsection
      - paragraph
      - subparagraph
      - point
    note: "Federal-statute shape, lower alpha first. Common in the South."
    codes: 81
    share: 0.11
  parenthetical-upper:
    rungs:
      - (A)
      - (1)
      - (a)
      - (i)
    elements:
      - subsection
      - paragraph
      - subparagraph
      - point
    note: As above but capitalized at the top rung.
    codes: 21
    share: 0.028
  outline-decimal:
    rungs:
      - "1"
      - "1.1"
      - "1.1.1"
      - "1.1.1.1"
      - "1.1.1.1.1"
    elements:
      - subsection
      - paragraph
      - subparagraph
      - point
      - indent
    note: "Compounding decimal outline, where each rung repeats its ancestors."
    codes: 0
    share: 0.0
  arabic-alpha:
    rungs:
      - "1."
      - a.
      - i.
      - (1)
    elements:
      - subsection
      - paragraph
      - subparagraph
      - point
    note: "Arabic first, no lettered level above it."
    codes: 0
    share: 0.0
container_elements:
  title: "hcontainer[title]"
  part: part
  subpart: "hcontainer[subpart]"
  division: "hcontainer[division]"
  subdivision: "hcontainer[subdivision]"
  chapter: chapter
  subchapter: "hcontainer[subchapter]"
  article: article
  appendix: "hcontainer[appendix]"
  schedule: "hcontainer[schedule]"
  exhibit: "hcontainer[exhibit]"
  annex: "hcontainer[annex]"
container_ladders:
  part-chapter-article:
    rungs:
      - part
      - chapter
      - article
    codes: 171
    share: 0.232
  chapter-article:
    rungs:
      - chapter
      - article
    codes: 150
    share: 0.203
  title-chapter-article:
    rungs:
      - title
      - chapter
      - article
    codes: 104
    share: 0.141
  title-chapter-article-division:
    rungs:
      - title
      - chapter
      - article
      - division
    codes: 76
    share: 0.103
  title-part-chapter-article:
    rungs:
      - title
      - part
      - chapter
      - article
    codes: 72
    share: 0.098
  part-chapter-article-division:
    rungs:
      - part
      - chapter
      - article
      - division
    codes: 54
    share: 0.073
  title-part-chapter-article-division:
    rungs:
      - title
      - part
      - chapter
      - article
      - division
    codes: 43
    share: 0.058
  chapter-article-division:
    rungs:
      - chapter
      - article
      - division
    codes: 29
    share: 0.039
  title-chapter:
    rungs:
      - title
      - chapter
    codes: 11
    share: 0.015
  title-part-chapter-subchapter-article-division:
    rungs:
      - title
      - part
      - chapter
      - subchapter
      - article
      - division
    codes: 5
    share: 0.007
  title-part-chapter:
    rungs:
      - title
      - part
      - chapter
    codes: 3
    share: 0.004
  title-chapter-subchapter-article:
    rungs:
      - title
      - chapter
      - subchapter
      - article
    codes: 3
    share: 0.004
note_forms:
  bracket:
    pattern: "\\[(?P<action>Added|Amended|Repealed|Deleted)\\s+(?P<rest>[^\\]]*)\\]"
    example: "[Amended 4-25-2023 ATM by Art. 23]"
    note: Eastern. The action is named and the instrument follows.
  parenthetical:
    pattern: "\\((?:Ord\\.|Ordinance)\\s*(?P<ordinance>[^,;)]+)(?P<rest>[^)]*)\\)"
    example: "(Ord. 84-34 § 2, 1985)"
    note: Western. The ordinance is named and the action is implied. This is the majority of provenance notes in the corpus by volume.
  history_block:
    pattern: "\\[HISTORY:\\s*(?P<rest>[^\\]]*)\\]?"
    example: "[HISTORY: Adopted by the Planning Board of the City of Beverly 11-16-2010]"
    note: "Instrument-level, at the head of a chapter. This is where the adopting body is named, and therefore where the instrument type comes from."
definition_forms:
  caps-dash:
    pattern: "^(?P<term>[A-Z][A-Z0-9 ,'’/&().\\-]{2,70})\\s*[—–-]{1,2}\\s+(?P<body>\\S.*)$"
    example: ACCESSORY STRUCTURE - A structure detached from ...
  quoted-means:
    pattern: "^[“\\\"'](?P<term>[^”\\\"']{2,70})[”\\\"']\\s+(?P<body>(?:means|shall mean).*)$"
    example: "\"Assembly\" means the governing body of the Borough."
  sentence-means:
    pattern: "^(?P<term>[A-Z][A-Za-z0-9 ,'’/&().\\-]{2,70})\\s+(?P<body>(?:means|shall mean).*)$"
    example: Accessory structure means a structure detached from ...
  caps-colon:
    pattern: "^(?P<term>[A-Z][A-Z0-9 ,.'’&()/–—\\-]{1,70}):\\s+(?P<body>\\S.*)$"
    example: 'ACCESSORY USE OR BUILDING:   A use or building which is ...'
states:
  AK:
    codes: 18
    citation: dotted-decimal
    enumeration: western-alpha
    containers: title-chapter-article
  AL:
    codes: 2
    citation: chapter-section
    enumeration: parenthetical-lower
    containers: chapter-article-division
  AR:
    codes: 2
    citation: chapter-section
    enumeration: eastern-bracket
    containers: chapter-article
  AZ:
    codes: 6
    citation: dotted-decimal
    enumeration: western-alpha
    containers: title-chapter-article-division
  CA:
    codes: 199
    citation: dotted-decimal
    enumeration: western-alpha
    containers: title-chapter-article-division
  CO:
    codes: 6
    citation: dotted-decimal
    enumeration: parenthetical-lower
    containers: title-part-chapter-article
  CT:
    codes: 88
    citation: chapter-section
    enumeration: eastern-bracket
    containers: part-chapter-article
  DE:
    codes: 23
    citation: chapter-section
    enumeration: eastern-bracket
    containers: part-chapter-article
  FL:
    codes: 1
    citation: chapter-section
    enumeration: eastern-bracket
    containers: part-chapter-article
  GA:
    codes: 1
    citation: chapter-section
    enumeration: parenthetical-lower
    containers: chapter-article-division
  HI:
    codes: 1
    citation: chapter-article-section
    enumeration: parenthetical-lower
    containers: title-chapter-article-division
  IA:
    codes: 2
    citation: flat
    enumeration: western-alpha
    containers: title-part-chapter-subchapter-article-division
  ID:
    codes: 2
    citation: dotted-decimal
    enumeration: western-alpha
    containers: title-chapter-article
  IL:
    codes: 39
    citation: chapter-section
    enumeration: eastern-bracket
    containers: part-chapter-article
  IN:
    codes: 5
    citation: dotted-decimal
    enumeration: parenthetical-upper
    containers: title-chapter-article-division
  KS:
    codes: 10
    citation: dotted-decimal
    enumeration: western-alpha
    containers: chapter-article
  KY:
    codes: 1
    citation: chapter-section
    enumeration: eastern-bracket
    containers: title-part-chapter-article
  MA:
    codes: 162
    citation: chapter-section
    enumeration: eastern-bracket
    containers: chapter-article
  MD:
    codes: 62
    citation: chapter-section
    enumeration: eastern-bracket
    containers: part-chapter-article
  ME:
    codes: 37
    citation: chapter-section
    enumeration: eastern-bracket
    containers: chapter-article
  MI:
    codes: 5
    citation: chapter-section
    enumeration: eastern-bracket
    containers: part-chapter-article
  NH:
    codes: 17
    citation: chapter-section
    enumeration: eastern-bracket
    containers: part-chapter-article
  NY:
    codes: 30
    citation: chapter-section
    enumeration: eastern-bracket
    containers: part-chapter-article
  RI:
    codes: 18
    citation: chapter-section
    enumeration: eastern-bracket
    containers: part-chapter-article
  VT:
    codes: 1
    citation: flat
    enumeration: parenthetical-lower
    containers: title-chapter-subchapter-article
