LovecaSim / compiler /tests /debug_sd1_parsing.py
trioskosmos's picture
Upload folder using huggingface_hub
2113a6a verified
from compiler.parser_v2 import AbilityParserV2
def debug_sd1_006():
parser = AbilityParserV2()
text = "{{toujyou.png|็™ปๅ ด}}ๆ‰‹ๆœญใฎใƒฉใ‚คใƒ–ใ‚ซใƒผใƒ‰ใ‚’1ๆžšๅ…ฌ้–‹ใ—ใฆใ‚‚ใ‚ˆใ„๏ผš่‡ชๅˆ†ใฎๆˆๅŠŸใƒฉใ‚คใƒ–ใ‚ซใƒผใƒ‰็ฝฎใๅ ดใซใ‚ใ‚‹ใ‚ซใƒผใƒ‰ใ‚’1ๆžšๆ‰‹ๆœญใซๅŠ ใˆใ‚‹ใ€‚ใใ†ใ—ใŸๅ ดๅˆใ€ใ“ใ‚Œใซใ‚ˆใ‚Šๅ…ฌ้–‹ใ—ใŸใ‚ซใƒผใƒ‰ใ‚’่‡ชๅˆ†ใฎๆˆๅŠŸใƒฉใ‚คใƒ–ใ‚ซใƒผใƒ‰็ฝฎใๅ ดใซ็ฝฎใใ€‚"
print(f"Parsing: {text}")
print("-" * 50)
# Manually split to see what parser_v2 sees
sentences = parser._split_sentences(parser._preprocess(text))
print(f"Sentences: {sentences}")
parsed = parser.parse(text)
print("\nParsed Abilities:")
for i, ab in enumerate(parsed):
print(f"Ability {i}:")
print(f" Raw: {ab.raw_text}")
print(f" Trigger: {ab.trigger}")
print(f" Effects: {len(ab.effects)}")
for eff in ab.effects:
print(f" - Type: {eff.effect_type}")
print(f" Val: {eff.value}")
print(f" Params: {eff.params}")
if __name__ == "__main__":
debug_sd1_006()