File size: 1,110 Bytes
155974e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""Smoke test for non-LLM rewrite pipeline."""

from __future__ import annotations

import sys
from pathlib import Path

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

from app.bootstrap import ensure_resources
from app.pipeline.orchestrator import rewrite_text, similarity_check


def main() -> None:
    ensure_resources()
    sample = (
        "It is important to note that effective communication plays a crucial role "
        "in organizational success. Furthermore, this approach facilitates seamless "
        "collaboration across multifaceted teams."
    )
    result = rewrite_text(sample, tone="Casual", strength=1, preserve_length=True)
    print("ENGINE:", result.engine)
    print("IN/OUT:", result.input_words, "->", result.output_words)
    print("REWRITE:\n", result.text)
    assert result.text.strip(), "empty rewrite"
    assert "furthermore" not in result.text.lower()
    sim = similarity_check(result.text, sample)
    print("OVERLAP:", sim.overlap_pct, sim.level)
    print("OK")


if __name__ == "__main__":
    main()