Spaces:
Sleeping
Sleeping
| import logging | |
| import json | |
| from app import get_first_els_result_matthew, calculate_gematria | |
| import bible | |
| # Set up logging | |
| logging.basicConfig(level=logging.DEBUG) | |
| logger = logging.getLogger(__name__) | |
| # Test values | |
| test_gematria_sum = 200 | |
| # Test process_json_files directly | |
| logger.info("Testing process_json_files directly...") | |
| results = bible.process_json_files( | |
| 40, 40, # Only Matthew (book 40 to 40) | |
| test_gematria_sum, # Use gematria sum as step | |
| "1,-1", # Default rounds_combination | |
| 0, # length | |
| "en", | |
| True, # strip_spaces | |
| True, # strip_in_braces | |
| True # strip_diacritics_value | |
| ) | |
| # Print all results | |
| logger.info(f"Got {len(results)} results from process_json_files") | |
| for i, result in enumerate(results): | |
| logger.info(f"Result {i+1}: Round {result.get('round')}, Text: {result.get('result_text')[:20]}...") | |
| # Test get_first_els_result_matthew | |
| logger.info(f"\nTesting get_first_els_result_matthew with sum {test_gematria_sum}...") | |
| matthew_result = get_first_els_result_matthew(test_gematria_sum) | |
| # Print the selected result | |
| if matthew_result: | |
| logger.info(f"Selected result - Round: {matthew_result.get('round')}, Text: {matthew_result.get('result_text')[:20]}...") | |
| logger.info(f"Gematria sum: {calculate_gematria(matthew_result['result_text'])}") | |
| else: | |
| logger.info("No result found from Matthew.") | |