sanscript 0.4.1 → 0.4.3
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 +4 -4
- data/lib/sanscript/transliterate.rb +12 -6
- data/lib/sanscript/transliterate/schemes.rb +3 -3
- data/lib/sanscript/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 978f081a49e46e4cade8a7cdef95ebdb89f7daac
|
4
|
+
data.tar.gz: e46caf2df596e745398a6a5ac86d2c11ed0c666d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0f01c0322755e57c5690799660e810cc7d85271c5b6ef185ce21b13f516c396f1ae8e090529ecbfa8fd8a9bfcce8519f15d4d3291188d6bc1f83279c0b59071
|
7
|
+
data.tar.gz: f87954bc573383f2ddf530274ef69dbe32e67ab49d3f49e6db90790abafef51e51c8596c22d044ae40b4907921c38fc26182342f0c96008492aec938e56afbc9
|
@@ -240,8 +240,8 @@ module Sanscript
|
|
240
240
|
token_buffer << data.slice!(0, map[:max_token_length] - token_buffer.length)
|
241
241
|
|
242
242
|
# Match all token substrings to our map.
|
243
|
-
|
244
|
-
token = token_buffer[0,
|
243
|
+
map[:max_token_length].downto(1) do |j|
|
244
|
+
token = token_buffer[0, j]
|
245
245
|
|
246
246
|
if !control_char && token == "##"
|
247
247
|
transliteration_enabled = !transliteration_enabled
|
@@ -280,17 +280,15 @@ module Sanscript
|
|
280
280
|
end
|
281
281
|
had_consonant = map[:consonants].key?(token)
|
282
282
|
end
|
283
|
-
token_buffer.slice!(0,
|
283
|
+
token_buffer.slice!(0, j)
|
284
284
|
break
|
285
|
-
elsif j ==
|
285
|
+
elsif j == 1 # Last iteration
|
286
286
|
if had_consonant
|
287
287
|
had_consonant = false
|
288
288
|
buf << map[:virama] unless options[:syncope]
|
289
289
|
end
|
290
290
|
buf << token
|
291
291
|
token_buffer.slice!(0, 1)
|
292
|
-
# 'break' is redundant here, "j == ..." is true only on
|
293
|
-
# the last iteration.
|
294
292
|
end
|
295
293
|
end
|
296
294
|
end
|
@@ -313,6 +311,10 @@ module Sanscript
|
|
313
311
|
until data.empty?
|
314
312
|
token = data.slice(0, 2)
|
315
313
|
if !control_char && token == "##"
|
314
|
+
if had_roman_consonant
|
315
|
+
buf << "a" if transliteration_enabled
|
316
|
+
had_roman_consonant = false
|
317
|
+
end
|
316
318
|
transliteration_enabled = !transliteration_enabled
|
317
319
|
data.slice!(0, 2)
|
318
320
|
next
|
@@ -323,6 +325,10 @@ module Sanscript
|
|
323
325
|
data.slice!(0, 2)
|
324
326
|
next
|
325
327
|
elsif transliteration_enabled && token == "{#"
|
328
|
+
if had_roman_consonant
|
329
|
+
buf << "a"
|
330
|
+
had_roman_consonant = false
|
331
|
+
end
|
326
332
|
transliteration_enabled = false
|
327
333
|
control_char = true
|
328
334
|
buf << token
|
@@ -25,7 +25,7 @@ module Sanscript
|
|
25
25
|
# 'va' and 'ba' are both rendered as ব.
|
26
26
|
#
|
27
27
|
bengali: {
|
28
|
-
vowels: "অ আ ই ঈ উ ঊ ঋ ৠ ঌ ৡ
|
28
|
+
vowels: "অ আ ই ঈ উ ঊ ঋ ৠ ঌ ৡ এ ঐ ও ঔ".w_split,
|
29
29
|
vowel_marks: "া ি ী ু ূ ৃ ৄ ৢ ৣ ে ৈ ো ৌ".w_split,
|
30
30
|
other_marks: "ং ঃ ঁ".w_split,
|
31
31
|
virama: ["্"],
|
@@ -107,7 +107,7 @@ module Sanscript
|
|
107
107
|
vowel_marks: "ਾ ਿ ੀ ੁ ੂ ੇ ੈ ੋ ੌ".w_split,
|
108
108
|
other_marks: "ਂ ਃ ਁ".w_split,
|
109
109
|
virama: ["੍"],
|
110
|
-
consonants: "ਕ ਖ ਗ ਘ ਙ ਚ ਛ ਜ ਝ ਞ ਟ ਠ ਡ ਢ ਣ ਤ ਥ ਦ ਧ ਨ ਪ ਫ ਬ ਭ ਮ ਯ ਰ ਲ ਵ
|
110
|
+
consonants: "ਕ ਖ ਗ ਘ ਙ ਚ ਛ ਜ ਝ ਞ ਟ ਠ ਡ ਢ ਣ ਤ ਥ ਦ ਧ ਨ ਪ ਫ ਬ ਭ ਮ ਯ ਰ ਲ ਵ ਸ਼ ਸ਼ ਸ ਹ ਲ਼ ਕ੍ਸ਼ ਜ੍ਞ".w_split,
|
111
111
|
symbols: "੦ ੧ ੨ ੩ ੪ ੫ ੬ ੭ ੮ ੯ ॐ ऽ । ॥".w_split,
|
112
112
|
other: " ਖ ਗ ਜ ਡ ਫ ".w_split,
|
113
113
|
},
|
@@ -258,7 +258,7 @@ module Sanscript
|
|
258
258
|
vowels: "a aa i ii u uu .r .rr .li .ll e ai o au".w_split,
|
259
259
|
other_marks: ".m .h ".w_split,
|
260
260
|
virama: [""],
|
261
|
-
consonants: 'k kh g gh "n c ch j jh ~n .t .th .d .
|
261
|
+
consonants: 'k kh g gh "n c ch j jh ~n .t .th .d .dh .n t th d dh n p ph b bh m y r l v ~s .s s h L k.s j~n'.w_split,
|
262
262
|
symbols: "0 1 2 3 4 5 6 7 8 9 o.m ' | ||".w_split,
|
263
263
|
},
|
264
264
|
|
data/lib/sanscript/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sanscript
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Bellefleur
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|