Skip to content

Conversation

@sharshi
Copy link
Member

@sharshi sharshi commented Jan 30, 2026

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 letter
    • findPesukimByName() - Find verses matching both starting and ending letters (primary use case for names)
    • extractHebrewLetters() - Extract Hebrew letters while removing nekudot (vowel points) and cantillation marks
  • Hebrew letter utilities:

    • normalizeHebrewLetter() - Convert final forms (ך, ם, ן, ף, ץ) to regular forms
    • getAllLetterForms() - Get all variants (regular and final) of a letter
  • Documentation:

    • Added comprehensive PASUK_RESEARCH.md with historical sources, technical implementation notes, and future enhancement ideas
    • Updated README with API documentation for new functions
    • Added extensive test coverage for all new functionality

Implementation Details

  • Final form handling: The search correctly handles Hebrew letters with final forms, allowing users to search for "ם" and matching verses ending with either "ם" or "מ"
  • Diacritical mark stripping: Properly removes all Hebrew diacritical marks (nekudot and cantillation marks) while preserving letter identity
  • Flexible filtering: All search functions support optional book filtering and result limits for performance
  • Historical context: Includes research on the minhag dating back to the Siddur of R' Hirz (1560) and confirmed by the Lubavitcher Rebbe

Testing

Added 30+ test cases covering:

  • Basic letter extraction with and without diacritical marks
  • Starting letter searches with book filtering
  • Name-based searches with final form handling
  • Edge cases and invalid inputs

https://claude.ai/code/session_015dW7YKUjy6K4r39jKFVpyH

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
@sharshi sharshi merged commit 5ef37fc into master Jan 30, 2026
3 checks passed
@sharshi sharshi deleted the claude/add-pesukim-letter-search-65Uwj branch January 30, 2026 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants