Skip to content

Commit

Permalink
Strip Peninei Halacha prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ronshapiro committed Oct 9, 2024
1 parent e906c8d commit 4d9405c
Show file tree
Hide file tree
Showing 14 changed files with 307 additions and 328 deletions.
22 changes: 17 additions & 5 deletions api_request_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,15 @@ class Comment {

const talmudPageLink = _internalLinkableRef?.toUrlPathname();

[sourceRef, sourceHeRef] = Comment.maybeRewriteRefNames(englishName, sourceRef, sourceHeRef);
if (englishName === "Shulchan Arukh") {
sourceRef = stripPossiblePrefix(sourceRef, "Shulchan Arukh, ");
sourceHeRef = stripPossiblePrefix(sourceHeRef, "שולחן ערוך, ");
const subtitle = shulchanArukhChapterTitle(ref);
if (subtitle) {
sourceHeRef = `${sourceHeRef} - ${subtitle}`;
if (ref.endsWith(":1")) {
hebrew = ShulchanArukhHeaderRemover.process(hebrew, englishName);
}
}
} else if (englishName === "Mishneh Torah") {
sourceRef = stripPossiblePrefix(sourceRef, "Mishneh Torah, ");
sourceHeRef = stripPossiblePrefix(sourceHeRef, "משנה תורה, ");
}

return new Comment(
Expand All @@ -190,6 +186,22 @@ class Comment {
);
}

static maybeRewriteRefNames(
englishName: string, sourceRef: string, sourceHeRef: string,
): [string, string] {
if (englishName === "Shulchan Arukh") {
sourceRef = stripPossiblePrefix(sourceRef, "Shulchan Arukh, ");
sourceHeRef = stripPossiblePrefix(sourceHeRef, "שולחן ערוך, ");
} else if (englishName === "Mishneh Torah") {
sourceRef = stripPossiblePrefix(sourceRef, "Mishneh Torah, ");
sourceHeRef = stripPossiblePrefix(sourceHeRef, "משנה תורה, ");
} else if (englishName === "Peninei Halakhah") {
sourceRef = stripPossiblePrefix(sourceRef, "Peninei Halakhah, ");
sourceHeRef = stripPossiblePrefix(sourceHeRef, "פניני הלכה, ");
}
return [sourceRef, sourceHeRef];
}

constructor(
readonly englishName: string,
readonly hebrew: sefaria.TextType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,15 @@
"en": "The time to recite the evening Keriat Shema is “when you lie down” – when people lie on their beds to sleep, which starts when it gets dark. The Chachamim established a sign for the beginning of this time, when three medium-sized stars can be seen in the sky. This is because large stars are also visible during the day or at bein hashemashot (twilight). However, when three medium-size stars (according to the naked eye) emerge after them, it is a sign that night has begun (HaZemanim BaHalachah chapters 49-50). This time is called tzeit hakochavim. To avoid error, and to prevent mistaking big stars for medium ones, the Rishonim write that one must wait until he sees three small stars appear in the sky (Talmidei Rabbeinu Yonah; Shulchan Aruch 235:1).",
"he": "זמן קריאת שמע של לילה הוא \"וּבְשָׁכְבְּךָ\" – בזמן שאנשים שוכבים על מיטתם. ותחילתו כשמחשיך, וקבעו לזה חכמים סימן: משיצאו שלושה כוכבים בינוניים. משום שהכוכבים שנראים לנו גדולים, כדוגמת נוגה, מאדים וצדק, נראים גם ביום או בבין השמשות. אבל כשיצאו שלושת הכוכבים שאחריהם, שהם נראים לנו בינוניים, אז הוא סימן לתחילת הלילה <span class=\"parenthesized\">(הזמנים בהלכה פרקים מט-נ)</span>. זמן זה נקרא 'צאת הכוכבים'. וכדי שלא יטעה אדם לחשוב שהגדולים הם הבינוניים, כתבו הראשונים שימתין עד שיראה שלושה כוכבים קטנים <span class=\"parenthesized\">(תר\"י, שו\"ע או\"ח רלה, א)</span>.",
"ref": "Peninei Halakhah, Prayer 25:5:2",
"sourceHeRef": "פניני הלכה, תפילה כה:ה:ב",
"sourceRef": "Peninei Halakhah, Prayer 25:5:2"
"sourceHeRef": "תפילה כה:ה:ב",
"sourceRef": "Prayer 25:5:2"
},
{
"en": "Even though according to Rabbi Yehudah the time to recite Ma’ariv and Birkot Keriat Shema starts at plag haminchah, the time of Keriat Shema itself does not begin until tzeit hakochavim. Therefore, a person praying before tzeit hakochavim must repeat the three paragraphs of Shema after tzeit hakochavim (Shulchan Aruch 235:1).",
"he": "ואף שלדעת רבי יהודה זמן תפילת ערבית וברכות קריאת שמע מתחיל מפלג המנחה, זמן קריאת שמע מצאת הכוכבים. לפיכך צריך המתפלל לפני צאת הכוכבים לחזור ולקרוא את שלוש פרשיות שמע אחר צאת הכוכבים <span class=\"parenthesized\">(שו\"ע או\"ח רלה, א)</span>.",
"ref": "Peninei Halakhah, Prayer 25:6:3",
"sourceHeRef": "פניני הלכה, תפילה כה:ו:ג",
"sourceRef": "Peninei Halakhah, Prayer 25:6:3"
"sourceHeRef": "תפילה כה:ו:ג",
"sourceRef": "Prayer 25:6:3"
}
]
}
Expand Down
Loading

0 comments on commit 4d9405c

Please sign in to comment.