[metadata]
code = "en"
name = "English"

[terminators]
chars = [".", "!", "?"]

# Limited pattern recognition for special cases
patterns = [
    { pattern = "!?", name = "surprised_question" },
    { pattern = "?!", name = "questioning_exclamation" }
]

[ellipsis]
# Default behavior: treat as boundary
treat_as_boundary = true
patterns = ["...", "…"]

# Context-based rules
context_rules = [
    { condition = "followed_by_capital", boundary = true },
    { condition = "followed_by_lowercase", boundary = false }
]

# Exception patterns (regex)
exceptions = [
    { regex = "\\b(um|uh|er)\\.\\.\\.", boundary = false }
]

[enclosures]
# Pairs are assigned IDs automatically based on array order
pairs = [
    { open = "(", close = ")" },
    { open = "[", close = "]" },
    { open = "{", close = "}" },
    { open = "'", close = "'", symmetric = true },
    { open = '"', close = '"', symmetric = true }
]

[suppression]
# Fast pattern matching for enclosure suppression
# TODO: Fast patterns currently only look at single characters before/after.
# This limitation prevents proper handling of patterns like "James'" where we need
# to distinguish between "That's" (contraction) and "James'" (possessive).
# Future enhancement: Extend fast_patterns to support multi-character sequences
# or add a special "possessive" pattern type for better performance.
fast_patterns = [
    { char = "'", before = "alpha", after = "alpha" },
    { char = "'", before = "s", after = "whitespace" }   # Possessive after s (partial support)
    # NOTE: the former line-start ")" list-item rule was removed: it also
    # suppressed the closing paren of ordinary parentheticals like "(note)"
    # at a line start, leaving the enclosure depth permanently unbalanced.
    # Bare list markers like "1)" are harmless without it, because unmatched
    # closing delimiters no longer suppress boundaries (negative depth).
]

# Regex patterns for more complex matching
regex_patterns = [
    { pattern = "\\(\\d{1,3}\\)", description = "Numbered references like (1), (12), (123)" },
    { pattern = "\\d+'\\d+\"", description = "Feet and inches like 5'9\"" },
    { pattern = "\\d+°\\d+'", description = "Degrees and minutes like 45°30'" },
    { pattern = "\\d+'", description = "Feet measurement like 6'" },
    { pattern = "\\d+\"", description = "Inches measurement like 12\"" },
    { pattern = "\\w+'s\\b", description = "Possessive forms like John's" },
    { pattern = "\\ws'\\s", description = "Plural possessive like students'" }
]

[abbreviations]
# Organized by category for maintainability
titles = [
    "Dr", "Prof", "Mr", "Mrs", "Ms", "Jr", "Sr"
    # TODO: These contain periods and need special handling
    # "Ph.D", "M.D", "B.A", "M.A", "B.S", "M.S"
]

academic = [
    "Ph.D", "M.D", "B.A", "M.A", "B.S", "M.S", "LL.B", "LL.M", "J.D", "D.D.S", "D.V.M", "M.I.T"
]

business = [
    "Inc", "Corp", "Ltd", "LLC", "Co", "L.P", "L.L.C", "P.C", "N.A"
]

time = [
    "a.m", "p.m", "A.M", "P.M"
]

geographic = [
    "U.S", "U.K", "U.S.A", "U.K", "E.U", "U.N", "D.C",
    # Note: Added back St with specific common usage pattern to avoid false matches
    "St", "Ave", "Blvd", "Pkwy",
    # TODO: These short abbreviations need word boundary checking
    # "Rd", "Dr", "Ct", "Ln", "Sq", "Pl", "Mt", "Ft", "Is", "Pt"
]

common = [
    "etc", "vs", "e.g", "i.e", "cf", "al", "seq", "no", "No", "vol", "Vol",
    # TODO: Single letter and short abbreviations need word boundary checking
    # "v", "pp", "p", "ed", "Ed", "trans", "Trans", "ca", "c", "esp", "viz"
]

measurement = [
    "oz", "lb", "lbs", "kg", "mg", "km", "cm", "mm", "ft", "yd",
    "mi", "hr", "min", "sec", "mph", "kph", "°F", "°C"
    # TODO: Single letter abbreviations need word boundary checking
    # "g", "m", "in"
]

month = [
    "Jan", "Feb", "Mar", "Apr", "Jun", "Jul", "Aug", "Sep", "Sept", "Oct", "Nov", "Dec"
]

military = [
    "Gen", "Col", "Maj", "Capt", "Lt", "Sgt", "Cpl", "Pvt", "Adm"
]

[sentence_starters]
require_following_space = true  # "The patient" matches but "Theater" does not
min_word_length = 1

# Personal pronouns
pronouns = [
    "I", "You", "He", "She", "It", "We", "They"
]

# Demonstrative pronouns
demonstratives = [
    "This", "That", "These", "Those"
]

# Articles and determiners
articles = [
    "The", "A", "An"
]

# Location adverbs
location_adverbs = [
    "There", "Here"
]

# Time adverbs
time_adverbs = [
    "Now", "Then"
]

# Conjunctions and transitions
conjunctions = [
    "However", "But", "And", "So", "Therefore", "Moreover", "Furthermore",
    "Meanwhile", "Finally", "Also", "Additionally", "Nevertheless", "Nonetheless",
    "Consequently", "Hence", "Thus"
]

# Question words
interrogatives = [
    "What", "When", "Where", "Why", "How", "Who", "Which", "Whose", "Whom"
]

# Common sentence starters that are often found after abbreviations
common_starters = [
    "Yes", "No", "Well", "Oh", "Ah", "Indeed", "Perhaps", "Maybe", 
    "Unfortunately", "Fortunately", "Surprisingly", "Interestingly",
    "Recently", "Currently", "Previously", "Generally", "Specifically",
    "Usually", "Often", "Sometimes", "Rarely", "Never", "Always",
    "Today", "Yesterday", "Tomorrow", "Later", "Earlier",
    "First", "Second", "Third", "Next", "Last", "Finally",
    "For", "Since", "Because", "Although", "While", "If", "Unless",
    "After", "Before", "During", "Throughout", "Despite", "Without"
]