ssmd 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -10
- data/SPECIFICATION.md +8 -8
- data/lib/ssmd/converter.rb +1 -1
- data/lib/ssmd/processors.rb +1 -0
- data/lib/ssmd/processors/break_processor.rb +35 -0
- data/lib/ssmd/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1072f2246db4e38fe72f48c909bd41a0ef3de15
|
4
|
+
data.tar.gz: 6d13a771d0699df8bd167d81b91d7c475788a1f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '079ba3acf4807aef4a98133a3ab572efa039e1e078ddc60a3f92e26011a2fb15706d06db416ba87b19417b5a483d87bb0b0a5277ea62e83d6ec684e820bebf0c'
|
7
|
+
data.tar.gz: 065fdf57abff4dabf7b6b58bd010b677974c6d070fea7ad5588dd8d62521dba498e4d5d09c9a4d401698049d9e45bc91dcc411c1b8dd3644075affd4f33d61f1
|
data/README.md
CHANGED
@@ -40,16 +40,19 @@ puts ssml
|
|
40
40
|
|
41
41
|
**Note:**
|
42
42
|
|
43
|
-
This version is still under development.
|
44
|
-
|
45
|
-
|
46
|
-
*
|
47
|
-
*
|
48
|
-
*
|
49
|
-
*
|
50
|
-
*
|
51
|
-
*
|
52
|
-
*
|
43
|
+
This version is still under development. See below which essential SSML constructs are implemented so far:
|
44
|
+
|
45
|
+
* [x] Text
|
46
|
+
* [x] Emphasis
|
47
|
+
* [x] Break
|
48
|
+
* [x] Language
|
49
|
+
* [x] Mark
|
50
|
+
* [x] Paragraph
|
51
|
+
* [x] Phoneme
|
52
|
+
* [x] Prosody
|
53
|
+
* [ ] Say-as
|
54
|
+
* [x] Substitution
|
55
|
+
* [ ] Extensions
|
53
56
|
|
54
57
|
## Development
|
55
58
|
|
data/SPECIFICATION.md
CHANGED
@@ -69,14 +69,14 @@ Hello ...100 world (100 millisecond break (max 10000ms))
|
|
69
69
|
|
70
70
|
SSML:
|
71
71
|
```html
|
72
|
-
Hello <break strength="x-strong"/>
|
73
|
-
Hello - <break strength="none"/>
|
74
|
-
Hello <break strength="medium"/>
|
75
|
-
Hello <break strength="strong"/>
|
76
|
-
Hello <break strength="x-strong"/>
|
77
|
-
Hello <break time="5s"/>
|
78
|
-
Hello <break time="100ms"/> world
|
79
|
-
Hello <break time="100ms"/>
|
72
|
+
Hello <break strength="x-strong"/> world (default: x-strong break like after a paragraph)
|
73
|
+
Hello - <break strength="none"/> world (skip break when there would otherwise be one like after this dash)
|
74
|
+
Hello <break strength="medium"/> world (medium break like after a comma)
|
75
|
+
Hello <break strength="strong"/> world (strong break like after a sentence)
|
76
|
+
Hello <break strength="x-strong"/> world (extra string break like after a paragraph)
|
77
|
+
Hello <break time="5s"/> world (5 second break (max 10s))
|
78
|
+
Hello <break time="100ms"/> world (100 millisecond break (max 10000ms))
|
79
|
+
Hello <break time="100ms"/> world (100 millisecond break (max 10000ms))
|
80
80
|
```
|
81
81
|
|
82
82
|
***
|
data/lib/ssmd/converter.rb
CHANGED
data/lib/ssmd/processors.rb
CHANGED
@@ -4,6 +4,7 @@ end
|
|
4
4
|
|
5
5
|
require 'ssmd/processors/processor'
|
6
6
|
require 'ssmd/processors/annotation_processor'
|
7
|
+
require 'ssmd/processors/break_processor'
|
7
8
|
require 'ssmd/processors/emphasis_processor'
|
8
9
|
require 'ssmd/processors/mark_processor'
|
9
10
|
require 'ssmd/processors/prosody_processor'
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require_relative 'processor'
|
2
|
+
|
3
|
+
module SSMD::Processors
|
4
|
+
class BreakProcessor < Processor
|
5
|
+
def result
|
6
|
+
name, value = attribute
|
7
|
+
|
8
|
+
"<break #{name}=\"#{value}\"/>"
|
9
|
+
end
|
10
|
+
|
11
|
+
def regex
|
12
|
+
/(?<=\s)\.\.\.(?:(?<comma>c)|(?<sentence>s)|(?<paragraph>p)|(?<s>\d+s)|(?<ms>\d+ms)|(?<num>\d+))?(?=\s)/
|
13
|
+
end
|
14
|
+
|
15
|
+
def attribute
|
16
|
+
if ms = (match[:num] || match[:ms])
|
17
|
+
if ms == "0"
|
18
|
+
["strength", "none"]
|
19
|
+
else
|
20
|
+
["time", "#{ms.to_i}ms"]
|
21
|
+
end
|
22
|
+
elsif s = match[:s]
|
23
|
+
["time", "#{s.to_i}s"]
|
24
|
+
elsif match[:paragraph]
|
25
|
+
["strength", "x-strong"]
|
26
|
+
elsif match[:sentence]
|
27
|
+
["strength", "strong"]
|
28
|
+
elsif match[:comma]
|
29
|
+
["strength", "medium"]
|
30
|
+
else
|
31
|
+
["strength", "x-strong"]
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/ssmd/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ssmd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Kahl
|
@@ -115,6 +115,7 @@ files:
|
|
115
115
|
- lib/ssmd/converter.rb
|
116
116
|
- lib/ssmd/processors.rb
|
117
117
|
- lib/ssmd/processors/annotation_processor.rb
|
118
|
+
- lib/ssmd/processors/break_processor.rb
|
118
119
|
- lib/ssmd/processors/emphasis_processor.rb
|
119
120
|
- lib/ssmd/processors/mark_processor.rb
|
120
121
|
- lib/ssmd/processors/paragraph_processor.rb
|