import re

QUESTION_STARTERS = [
    "what", "why", "how", "when", "where",
    "who", "whom", "which", "can", "could",
    "should", "would", "do", "does", "did"
]


def questioning_rule(text: str) -> int:
    """
    Returns:
        1 -> Questioning
        0 -> Not questioning
    """
    t = text.lower().strip()

    # strong signal: question mark
    if t.endswith("?"):
        return 1

    # grammatical signal: interrogative start
    for w in QUESTION_STARTERS:
        if re.match(rf"^{w}\b", t):
            return 1

    return 0
