#! /usr/bin/python3 # Last edited on 2026-10-07 06:01:46 by stolfi ######################################################################### # # If {utype} is "ch", the sizes are hanzi counts, excluding Nature, Alias, # and Provenance. # # if {utype} is {ec}, read sizes in EVA characters, removing @qo and # expanding @ir, @m. # file converted to the assumed (fractional) equivalents in hanzi chars. sum_rsz = 0 # Use the nominal avg num of Chinese chars per unit: trim_ch = False # !!! Should be true !!! del_qo = False exp_irm = False hanzi_per_unit = spf.default_hanzi_per_unit(utype, trim_ch, del_qo, exp_irm) err.write(f"assumed avg units per recipe = {hanzi_per_unit:8.2f}\n") rsz_k = nun_k*hanzi_per_unit sum_rsz += rzz_k avg_rsz = sum_rsz/npara err.write(f"{avg_rsz:8.3f} average hanzi size per parag\n") ######################################################################### def data_warning(msg): err.write(f"stdin:{nline}: !! {msg}\n") err.write(f" [[{line}]]\n") return # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~