"""Day 3 assignment: a streaming word-frequency command."""

import sys
from dataclasses import dataclass
from typing import TextIO


@dataclass(frozen=True)
class WordCount:
    word: str
    count: int


def count_words(source: TextIO, fold: bool) -> dict[str, int]:
    """Count runs of Unicode letters or digits from source."""
    raise NotImplementedError


def top_n(counts: dict[str, int], n: int) -> list[WordCount]:
    """Return count-descending, word-ascending results."""
    raise NotImplementedError


def run(args: list[str], stdin: TextIO, stdout: TextIO, stderr: TextIO) -> int:
    """Run the CLI using only the supplied streams."""
    raise NotImplementedError


if __name__ == "__main__":
    sys.exit(run(sys.argv[1:], sys.stdin, sys.stdout, sys.stderr))
