Odsiewanie szumu + rozwijanie skrótów sygnifikatorów
- abbreviations.py: słownik skrót -> pełna nazwa (z SIGNIFICATORS KEY, built-in) + expand(): [Su in [Tau -> "Sun in Taurus", [Sa in 6th H. -> "...6th house", affl. -> afflicted itd. - significators: każda próbka ma pole "expanded" (postać czytelna); hartowanie filtra szumu (efekty zastępcze x/?/-, wiersze *MARKER, legendy/nagłówki). - prezentacja /interpret: pokazuje rozwiniętą postać, surowy skrót w tooltipie. Zweryfikowano na realnym main_base.xlsx: "[Sa or [Ma in the 5th H." -> "Saturn or Mars in the 5th house". 9 testów przechodzi (w tym test_abbreviations). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
"""Testy rozwijania skrótów sygnifikatorów."""
|
||||
from app.abbreviations import expand
|
||||
|
||||
|
||||
def test_planet_in_sign():
|
||||
assert expand("[Su in [Tau") == "Sun in Taurus"
|
||||
|
||||
|
||||
def test_aspect_and_house():
|
||||
assert expand("[Sa [conj [Su in 6th H.") == "Saturn conjunction Sun in 6th house"
|
||||
|
||||
|
||||
def test_affliction_word_and_house():
|
||||
assert expand("[Ne affl. in the 7th H.") == "Neptune afflicted in the 7th house"
|
||||
|
||||
|
||||
def test_unknown_token_kept_without_bracket():
|
||||
assert expand("[Xyz rising") == "Xyz rising"
|
||||
|
||||
|
||||
def test_empty_passthrough():
|
||||
assert expand("") == ""
|
||||
@@ -25,6 +25,7 @@ def test_sign_and_house_facets():
|
||||
facets = {f["type"]: f for f in item["facets"]}
|
||||
assert facets["sign"]["count"] == 1
|
||||
assert facets["sign"]["samples"][0]["effect"] == "efekt znak"
|
||||
assert facets["sign"]["samples"][0]["expanded"] == "Sun in Taurus" # rozwinięcie skrótu
|
||||
assert facets["house"]["count"] == 1
|
||||
assert facets["house"]["token"] == "11th H."
|
||||
assert facets["house"]["samples"][0]["effect"] == "efekt dom"
|
||||
|
||||
Reference in New Issue
Block a user