INNER CODE UNIT · Python

fng_statistics_term

rfc-st/humble · humble.py:374

def fng_statistics_term(fng_term):
    """Count fingerprint headers per provided term.

    Exit if no results are found, related to `-f` option.
    """
    print(
        f"\n{STYLE[0]}{get_detail('[fng_stats]', replace=True)}"
        f"{STYLE[4]}{get_detail('[fng_source]', replace=True)}\n",
    )
    fng_incl = PATHS["fingerprint_term"].read_text(encoding="utf8").splitlines(
        keepends=True,
    )[SLICE_INT[0]:]
    fng_groups, term_cnt = fng_statistics_term_groups(fng_incl, fng_term)
    if not fng_groups:
        print(
            f"{get_detail('[fng_zero]', replace=True)} '{fng_term}'.\n\n"
            f"{get_detail('[fng_zero_2]', replace=True)}.\n",
        )

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…