Add verse search by name letters for Shemona Esre custom#11
Merged
Conversation
Implement comprehensive search functionality for finding biblical verses by starting and ending Hebrew letters, supporting the minhag (custom) of reciting personal verses in Shemona Esre prayer. Features added: - extractHebrewLetters(): Remove nekudot and cantillation marks from Hebrew text - normalizeHebrewLetter(): Convert final forms to regular forms - getAllLetterForms(): Get all forms (regular and final) of a letter - findPesukimByStartingLetter(): Find verses starting with a specific letter - findPesukimByName(): Find verses for names (start/end letters) Key capabilities: - Handles Hebrew final forms (ך, ם, ן, ף, ץ) bidirectionally - Preserves spaces in extracted text by default - Supports filtering by specific books - Supports limiting result count - Comprehensive test coverage (34 tests passing) Documentation: - Updated README with new API functions and examples - Created PASUK_RESEARCH.md with research sources and enhancement ideas - Removed all emojis from project per user request https://claude.ai/code/session_015dW7YKUjy6K4r39jKFVpyH
Implement a comprehensive system for tracking and retrieving traditional verses used for the minhag of saying a pasuk for one's name in Shemona Esre. New Features: - Preferred verses database with 22 letter combinations (extensible to 484) - VerseResult.preferred flag to mark traditional choices - getPreferredPasukForName() for direct access to traditional verses - Automatic sorting: preferred verses appear first in search results - JSON-based data system for easy community contributions - Processing script that parses Hebrew/English references and gematria Technical Implementation: - New preferred-verses.ts module with type-safe verse mappings - Parser handles Hebrew book names, chapter numbers (gematria), and English references - Automatic normalization of final forms (sofit letters) - O(1) lookup performance using Map data structure - Extensible architecture: add verses by editing JSON and re-running script Testing: - 41 tests passing (7 new tests for preferred verses) - Comprehensive coverage of edge cases - Validates preferred verse marking and sorting Documentation: - README updated with preferred verses API and examples - PASUK_RESEARCH.md expanded with implementation phases - New ADDING_PREFERRED_VERSES.md guide for community contributions - Clear instructions for extending the database Data Format: - Input: JSON with "letter-combo": ["text", "reference"] format - Processing: Node.js script converts to TypeScript - Output: Type-safe PreferredVerse[] with book/chapter/verse - Supports "No source" for letter combos without traditional verses Ready for community expansion to complete aleph-bet coverage! https://claude.ai/code/session_015dW7YKUjy6K4r39jKFVpyH
- Change JSON format from array with text to object with references only - Remove text field from PreferredVerse interface (fetched from tanach data) - Update processing script to handle both old and new formats - Simplify preferred-verses.ts by removing text duplication - Maintain single source of truth for verse text in tanach data - Update documentation to reflect reference-only approach https://claude.ai/code/session_015dW7YKUjy6K4r39jKFVpyH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive verse search functionality to find personal pesukim (biblical verses) based on Hebrew name letters, supporting the Jewish custom of reciting a verse that begins with the first letter of one's name and ends with the last letter during the Shemona Esre (Amidah) prayer.
Key Changes
New search functions:
findPesukimByStartingLetter()- Find verses beginning with a specific Hebrew letterfindPesukimByName()- Find verses matching both starting and ending letters (primary use case for names)extractHebrewLetters()- Extract Hebrew letters while removing nekudot (vowel points) and cantillation marksHebrew letter utilities:
normalizeHebrewLetter()- Convert final forms (ך, ם, ן, ף, ץ) to regular formsgetAllLetterForms()- Get all variants (regular and final) of a letterDocumentation:
PASUK_RESEARCH.mdwith historical sources, technical implementation notes, and future enhancement ideasImplementation Details
Testing
Added 30+ test cases covering:
https://claude.ai/code/session_015dW7YKUjy6K4r39jKFVpyH