I am writing a program to do various computations with the Torah. To do this I need to remove all punctuation, spaces and other notations.

I have removed the (פ) breaks and all non-Hebrew letters (including nikodot) from the sefaria chumash using the regular expression: "\\(.\\)|\\[.*?\\]|[^\u05D0-\u05EA]" (i.e. any single letter in parenteces, any non Hebrew letter, any hebrew letters with punctuation or any pattern within brackets - to account for kiris) . However I seem to still have 45 extra letters.

See http://www.filedropper.com/biblestats_2 for the output of the program. Each line has a before and after version of the text. At the end of each book I print out the stats thus far. At the end of the entire file, I print the stats of the entire Torah.

I am getting:

Total: Verses: 5846, Letters: 304850
Total Frequencies:
א: 27060
ב: 16345
ג: 2109
ד: 7032
ה: 28055
ו: 30533
ז: 2198
ח: 7189
ט: 1804
י: 31556
ך: 3358
כ: 8610
ל: 21570
ם: 10624
מ: 14466
ן: 4259
נ: 9867
ס: 1833
ע: 11250
ף: 830
פ: 3975
ץ: 1035
צ: 2927
ק: 4695
ר: 18125
ש: 15595
ת: 17950

However according to http://www.aishdas.org/toratemet/en_pamphlet9.html and other sources there should be only 304,805 letters. Where are the extra 45 letters coming from?

  • 2
    Did you exclude by accident the dotted letters (eg. לנו ולבנינו)? Did you include by accident the upside down nuns? – Double AA Jul 23 '15 at 14:07
  • What's the location of that verse? Luckily the inverted nun is not part of the \u05D0-\u05EA unicode character range. – Ani Yodea Jul 23 '15 at 14:08
  • 1
    Dotted letters are in eg. Dev 29 28, and nuns in the end of Bamidbar 10 – Double AA Jul 23 '15 at 14:10
  • 1
    Before: Deuteronomy (29, 28): הַ֨נִּסְתָּרֹ֔ת לַיהוָ֖ה אֱלֹהֵ֑ינוּ וְהַנִּגְלֹ֞ת לָ֤ׄנׄוּׄ וּׄלְׄבָׄנֵׄ֙יׄנׄוּׄ֙ עַד־עוֹלָ֔ם לַעֲשׂ֕וֹת אֶת־כָּל־דִּבְרֵ֖י הַתּוֹרָ֥ה הַזֹּֽאת׃ (ס) After:Deuteronomy (29, 28): הנסתרתליהוהאלהינווהנגלתלנוולבנינועדעולםלעשותאתכלדבריהתורההזאת Seems fine. – Ani Yodea Jul 23 '15 at 14:13
  • 4
    Kri UKsivs will get you. – Shalom Jul 23 '15 at 14:27

I think there are 304805 letters in a Sefer Torah but 304850 or 304848 letters in the text as found in a famous manuscript, the 'Leningrad codex', which many academics use. Sefaria is based on the Leningrad codex from tanach.us. I haven't seen a list of the differences, but an example is האלילם/האלילים in Leviticus 19:4.

  • This is quite plausible (the example you bring is accurate). Are you sure the total is 304850? – Double AA Jul 23 '15 at 22:47
  • No, I'm not sure about anything. Several websites say 304848 and several say 304850. – JeremyR Jul 23 '15 at 22:53
  • 1
    @AniYodea Sefaria is probably a very accurate representation of the Leningrad Codex. Is there a specific other text of the Torah you are looking for? – Double AA Jul 23 '15 at 23:43
  • 1
    @AniYodea "best for bible codes" Depends what your searching for :) Your link was probably using some other text (likely Minchat Shai's) to make its count. – Double AA Jul 23 '15 at 23:52
  • 3
    @AniYodea Kiddushin 30a. – Double AA Jul 24 '15 at 13:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .