File size: 1,202 Bytes
6f36505 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | """Minimal usage example for hv-reader."""
from hv_reader import HVReader
TEXT = (
"The old man walked slowly to the boat. He stopped, looked at the "
"water, and then continued. The sea was quiet that morning. He "
"pushed the boat into the water and climbed in. The oars were cold "
"in his hands. He rowed out past the harbor and into the open sea."
)
def main() -> None:
model = HVReader()
profile = model.analyze(TEXT)
print("=" * 60)
print("hv-reader")
print("=" * 60)
print(model.render(profile))
print()
print("=" * 60)
print("Numeric summary")
print("=" * 60)
print(f" sentences : {profile.n_sentences}")
print(f" words : {profile.n_words}")
print(f" pace : {profile.pace:.4f}")
print(f" memory : {profile.memory:.4f}")
print(f" passes : {profile.passes:.4f}")
print(f" slip : {profile.slip:.4f}")
print(f" wall : {profile.wall:.4f}")
print(f" ttu_s : {profile.ttu_s:.2f}")
print(f" mean_wpm : {profile.mean_wpm:.1f}")
print(f" hunger_final : {profile.hunger_final:+.2f}")
print()
if __name__ == "__main__":
main() |