romanized_hebrew 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: fc125022b5101cd4196d95f009cc2f7b6b83aa6f945841ff2a8bc43e0ff6a511
4
+ data.tar.gz: 2b78fe60ec46c16f94799360cac55e6df7d89b10851086705c5de933d2d8dc1c
5
+ SHA512:
6
+ metadata.gz: 10b5778b44903dbf40c57a10daef40325a9c344fba17b77ccf610dbe0c559c34db46c367fa1c651dd140b17e109d7d406ac42720cc41943b485d48082ffd0868
7
+ data.tar.gz: 4ef964215498b137dcd3eb482a4f10053272917cfa1bd0c0763dc76a5c8c3a86f1bf037136c17ebbc4c218202e815ce0d736b31a21f1b4b9e3d60f513e185054
checksums.yaml.gz.sig ADDED
Binary file
@@ -0,0 +1,100 @@
1
+ # Romanized Hebrew library
2
+
3
+ # RomanizedHebrew converts the romanization menthod used by the
4
+ # English occultists of the 19th and 20th centuries. It is as follows:
5
+ #
6
+ # A = aleph B = beth G = gimel D = dalet
7
+ # H = heh V = vav Z = zayin Ch = chet
8
+ # T = teth I = yod K = kaf L = lamed
9
+ # M = mem N = nun S = samekh O = ayin
10
+ # P = peh Tz = tzaddi Q = qoph R = resh
11
+ # Sh = shin Th = tav
12
+ #
13
+ # Ligatures:
14
+ # Ii = yod-yod Vi = vav-yod Vv = vav-vav
15
+ #
16
+ # Niqqud:
17
+ # ; = Sh'va * = Dagesh
18
+ # \\ = Kubutz ` = Holam
19
+ # 1 = Hiriq 2 = Zeire
20
+ # 3 = Segol ;3 = Reduced Segol
21
+ # _ = Patach ;_ = Reduced Patach
22
+ # 7 = Kamatz ;7 = Reduced Kamatz
23
+ # Shl = Shin dot left Shr = Shin dot right
24
+ # ;; = escape an actual semicolon
25
+ #
26
+ # Letters which can be final can take a 'f' or 'i' prefix to
27
+ # force the interpretation to be 'final' or 'initial'... otherwise
28
+ # a letter at the end of a word is considered final.
29
+ class RomanizedHebrew
30
+ NIQQUD = %r!;[;37_]? | [1237_*\\`]!x
31
+ INFERRED_FINAL = %r!
32
+ (?:K|M|N|P|Tz) # one of the possibly-final letters
33
+ (?= #{NIQQUD}*+ # looking at niqqod
34
+ (?:\W|\Z)) # ... followed by a non-word or end-of-line
35
+ !x
36
+ TRANSLITERATE = %r!
37
+ ([A-Z][fhilvz]*+) # consonant (and Shin dots)
38
+ (#{NIQQUD}?+)(#{NIQQUD}?+) # possible niqqud
39
+ !x
40
+
41
+ @trans_tbl = { # transliteration table
42
+ # aleph, beth, gimel, dalet
43
+ 'A' => "\u05d0", 'B' => "\u05d1", 'G' => "\u05d2", 'D' => "\u05d3",
44
+ # heh, vav, zain, cheth
45
+ 'H' => "\u05d4", 'V' => "\u05d5", 'Z' => "\u05d6", 'Ch' => "\u05d7",
46
+ # tayt, yod, kaf_final, kaf, kaf_initial
47
+ 'T' => "\u05d8", 'I' => "\u05d9", 'Kf' => "\u05da", 'K' => "\u05db", 'Ki' => "\u05db",
48
+ # lamed, mem_final, mem, mem_initial, nun_final
49
+ 'L' => "\u05dc", 'Mf' => "\u05dd", 'M' => "\u05de", 'Mi' => "\u05de", 'Nf' => "\u05df",
50
+ # nun, samekh, ayin, peh_final
51
+ 'N' => "\u05e0", 'Ni' => "\u05e0", 'S' => "\u05e1", 'O' => "\u05e2", 'Pf' => "\u05e3",
52
+ # peh, peh_initial, tzaddi_final, tzaddi, tzaddi_initial
53
+ 'P' => "\u05e4", 'Pi' => "\u05e4", 'Tzf' => "\u05e5", 'Tz' => "\u05e6", 'Tzi' => "\u05e6",
54
+ # qoph, resh, shin, tav
55
+ 'Q' => "\u05e7", 'R' => "\u05e8", 'Sh' => "\u05e9", 'Th' => "\u05ea",
56
+ # Ligatures
57
+ # doube-yod, double-vav, vav-yod
58
+ 'Ii' => "\u05f2", 'Vv' => "\u05f0", 'Vi' => "\u05f1",
59
+ # niqqud
60
+ ';;' => ';', # escape an actual semicolon
61
+ ';' => "\u05b0", # Sh'va
62
+ ';3' => "\u05b1", # Reduced Segol
63
+ ';_' => "\u05b2", # Reduced Patach
64
+ ';7' => "\u05b3", # Reduced Kamatz
65
+ '1' => "\u05b4", # Hiriq
66
+ '2' => "\u05b5", # Zeire
67
+ '3' => "\u05b6", # Segol
68
+ '_' => "\u05b7", # Patach
69
+ '7' => "\u05b8", # Kamatz
70
+ '*' => "\u05bc", # Dagesh
71
+ '\\' => "\u05bb", # Kubutz
72
+ '`' => "\u05b9", # Holam
73
+ 'Shl' => "\u05e9\u05c2", # Shin dot left
74
+ 'Shr' => "\u05e9\u05c1" # Shin dot right
75
+ }
76
+ @trans_tbl.default_proc = Proc.new {|h,k| k } # identity when unknown chars appear
77
+
78
+ # Convert a romanized hebrew string, `rom`, to actual hebrew. If the format is set to
79
+ # `:html`, then the output is a series of hexadecimal html entities, which can be
80
+ # easier to work with than mixing RTL and LTR languages in a file.
81
+ #
82
+ # RomanizedHebrew.convert('ABG') # => אבג
83
+ # RomanizedHebrew.convert('ABG', format: :html) # => אבג
84
+ def self.convert(rom, format: :unicode)
85
+ # first, add automatic final letters
86
+ hebrew = rom.gsub(INFERRED_FINAL, '\0f')
87
+ # second, perform the transliteration
88
+ hebrew.gsub!(TRANSLITERATE) do |m|
89
+ "#{@trans_tbl[$1]}#{@trans_tbl[$2]}#{@trans_tbl[$3]}"
90
+ end
91
+ # finally, convert to html entities if needed
92
+ if format == :html then
93
+ hebrew = hebrew.codepoints.map do |cp|
94
+ cp > 127 ? "&\#x#{cp.to_s(16)};" : cp.chr
95
+ end.join('')
96
+ end
97
+ hebrew
98
+ end
99
+
100
+ end
data.tar.gz.sig ADDED
Binary file
metadata ADDED
@@ -0,0 +1,74 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: romanized_hebrew
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Richard Todd
8
+ autorequire:
9
+ bindir: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ZC53
28
+ ZXNsZXkudG9kZEBnbWFpbC5jb20wKAYDVR0SBCEwH4EdcmljaGFyZC53ZXNsZXku
29
+ dG9kZEBnbWFpbC5jb20wDQYJKoZIhvcNAQELBQADggGBAH0e5AxjTWi61jv1c+0N
30
+ BKhR1AYIG3b76lW5FYzwwUsdQWEDIMiDuqGYU+TLIoCILa/PSnuVyoVshzBJhOyV
31
+ d/HaM0+clcaHa/rhqI4PtY3eOMW58e/To1dKvru8QfyUTy4KdSz2ETVliNGh+4HN
32
+ Ft3/WqgEmwQsVsWKfvlldg9qmM20dgyn7P50CF2fx4MRdrpXKomDoK8aV7iUoaCE
33
+ Q4my4ZRA6lMiaSN4GI1BG1T+qYFE2YoDl5Ako4BIFvGgUbBkj2Hch+P+wnGJkw7m
34
+ bgRMhCH9xl3z8f167zIghNDkCFY541EKBQt8sDRRzTkohg0sz4+bgirfhQlQPrzI
35
+ P6BznyHsH1zchecDaX7bMZylACxISH3beJWUTybIxOApKK2WVHFjSTwCo6LLaAox
36
+ F4N2DQ+zWN/3QJeBhuhKb6E5CESZ3gFKrYzucXZwIlbYSbW3v+43niQAvCjy4ef2
37
+ mFxhcR0tTgLoosbpbTbKgowVeGIFOARJZXGWUzkEb9UiKg==
38
+ -----END CERTIFICATE-----
39
+ date: 2023-08-07 00:00:00.000000000 Z
40
+ dependencies: []
41
+ description: "The romanized_hebrew gem was built to \nconvert the hebrew romanization
42
+ commonly used by the 19th and 20th-century\nEnglish occultists (e.g. Mathers, Waite,
43
+ etc) into actual hebrew unicode. It\ncan provide the unicode string, or a string
44
+ of HTML entities.\n"
45
+ email: rwtodd@users.noreply.github.com
46
+ executables: []
47
+ extensions: []
48
+ extra_rdoc_files: []
49
+ files:
50
+ - lib/romanized_hebrew.rb
51
+ homepage: https://github.com/rwtodd/romanized_hebrew
52
+ licenses:
53
+ - MIT
54
+ metadata: {}
55
+ post_install_message:
56
+ rdoc_options: []
57
+ require_paths:
58
+ - lib
59
+ required_ruby_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ required_rubygems_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ requirements: []
70
+ rubygems_version: 3.4.10
71
+ signing_key:
72
+ specification_version: 4
73
+ summary: Converts romanized hebrew to unicode hebrew letters.
74
+ test_files: []
metadata.gz.sig ADDED
@@ -0,0 +1,3 @@
1
+ k��b�����l�8�f7ca�iF������ �����d <��$(6�s�pX�:�be�� ai1OY�o���G� �6B@�8�`�aH��ذ�0�v�*�]�V9Q���T��O(�&�e.f�Rl�d���MO[��_\I [�}� �0�}~���P��?�2���W;.�U���,t$Tc�gU�L���FX�E�+&���~�\9S�b3�H ��&�6��:���,�V5oՃ�h��k���ƿ�k��&�&h�����t�U�'�G��U��iU˒�P����
2
+ �c
3
+ ���Q/�l@l�PoI����%��HjeH�ثH�)˗.ѹ�Z��+�c���}c�sS