File size: 1,038 Bytes
8f6d79d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from __future__ import annotations

import random
import sys
from pathlib import Path

ROOT = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(ROOT))

from app.pipeline.orchestrator import _require_visible_rewrite, _try_restructure_unit
from app.pipeline.restructure import restructure_sentence

samples = [
    "Ram went to school yesterday happily.",
    "Nowadays many people are living an unhealthy life because they don't have enough time.",
    "Online learning makes education more accessible for students in remote areas.",
    "Sleeping is still an important thing.",
    "Climate change is causing more extreme weather events around the world.",
    "Without enough sleep, the brain cannot work properly.",
]

for s in samples:
    rr = restructure_sentence(s)
    print("SRC:", s)
    print("  rr:", None if not rr else (rr.template_id, rr.text))
    print("  try:", _try_restructure_unit(s))
    print("  vis:", _require_visible_rewrite(s, s, "Neutral", random.Random(1)))
    print()