Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,25 @@ vite.config.ts.timestamp-*
# Added by cargo

/target

# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
1 change: 1 addition & 0 deletions tests/expected_harappan_output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"Expected decoded output from the Harappan script input"
1 change: 1 addition & 0 deletions tests/test_harappan_input.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"Example Harappan script input string"
6 changes: 6 additions & 0 deletions undec_script_decoder/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""
undec_script_decoder - A decoder for undeciphered scripts (Harappan/Indus)
"""
from .undec import decode

__all__ = ['decode']
16 changes: 16 additions & 0 deletions undec_script_decoder/decode_text.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from .undec import decode

def undec_decode(input_str):
"""
A simple wrapper for the undec.decode() function.
"""
return decode(input_str)

if __name__ == '__main__':
import sys
if len(sys.argv) > 1:
input_text = sys.argv[1]
decoded_text = undec_decode(input_text)
print(decoded_text)
else:
print("Usage: python -m undec_script_decoder.decode_text \"<your_script_text>\"")
30 changes: 30 additions & 0 deletions undec_script_decoder/undec.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""
Core decode function for undeciphered scripts.
Wraps the blackbox_indus_decoder from the parent module.
"""
import json
import sys
import os

# Add parent directory to path to import the blackbox decoder
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

try:
from undec_script_blackbox import blackbox_indus_decoder
except ImportError:
# Fallback if import fails
def blackbox_indus_decoder(quest_glyph="base-symbol"):
return json.dumps({"error": "Decoder not available", "input": quest_glyph})


def decode(input_str):
"""
Decode undeciphered script input.

Args:
input_str: The script text or glyph identifier to decode

Returns:
The decoded output as a string (JSON format)
"""
return blackbox_indus_decoder(input_str)