tscripter 0.1.2 → 0.1.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/README.md +71 -16
- data/lib/tscripter.rb +2 -2
- data/lib/tscripter/version.rb +1 -1
- data/test_input.txt +8 -8
- data/tscripter-0.1.1.gem +0 -0
- metadata +3 -3
- data/lib/test_input.txt +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 313653814cd5a9837b7d68eef157798c989801f3
|
4
|
+
data.tar.gz: 1516a38bd9f606d27d5ea40943313d116a4993c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4267ee3298c0afe598f7acada5ddf49f1ffc45b175302ee4c15b4b7d59c2fa7f4647b0d3ee1a122d8cb462b5bb84234037361aee66eeb36ab52592f184bd27ed
|
7
|
+
data.tar.gz: b131ce9dedb922955137eed63d48e313ee9400d72a7e9b7aaa3c7ece57edfc8c18533849a8824ffc94acba6f14ca724de203c5143e110ab2226621d7730a5bcb
|
data/README.md
CHANGED
@@ -1,23 +1,78 @@
|
|
1
1
|
# Tscripter
|
2
2
|
|
3
|
-
This gem edits transcript files
|
3
|
+
This gem edits transcript files. Files must be plaintext (.txt).
|
4
4
|
|
5
|
-
Current features:
|
6
|
-
-
|
7
|
-
- Detect spoken lines that start with stage directions
|
8
|
-
- Implement notation for consecutive lines by the same speaker
|
5
|
+
## Current features:
|
6
|
+
- Prepend alternating IDs to spoken lines
|
9
7
|
- If a line starts with `^`, then the speaker is the same as the previous line
|
10
|
-
-
|
11
|
-
|
12
|
-
|
8
|
+
- Example:
|
9
|
+
```
|
10
|
+
You've changed, Heathcliff...
|
11
|
+
[looks to the moon]
|
12
|
+
^ ...and I don't know who you are anymore.
|
13
|
+
That's not true!
|
14
|
+
```
|
15
|
+
becomes...
|
16
|
+
```
|
17
|
+
Cathy: You've changed, Heathcliff...
|
18
|
+
[looks to the moon]
|
19
|
+
Cathy: ...and I don't know who you are anymore.
|
20
|
+
Heathcliff: That's not true!
|
21
|
+
```
|
22
|
+
|
23
|
+
- Replace pattern `*i MM:SS` (where MM:SS is any timestamp) with `inaudible [MM:SS]`
|
24
|
+
- Example:
|
25
|
+
```
|
26
|
+
But what if *i 10:05 to the end?
|
27
|
+
```
|
28
|
+
becomes...
|
29
|
+
```
|
30
|
+
Heathcliff: But what if [inaudible 10:05] to the end?
|
31
|
+
```
|
32
|
+
- Note: Currently only supports MM:SS timestamps, not HH:MM:SS
|
33
|
+
|
34
|
+
- Lines that contain _only_ stage directions (text inside [square brackets]) are left intact
|
35
|
+
|
36
|
+
- Lines that contain _only_ whitespace are left intact
|
37
|
+
|
38
|
+
## Sample input and output
|
39
|
+
|
40
|
+
Input:
|
41
|
+
```
|
42
|
+
Hello there.
|
43
|
+
|
44
|
+
Hello to you too.
|
45
|
+
|
46
|
+
Lovely night on the moors.
|
47
|
+
[uncomfortable silence]
|
48
|
+
This is splendid, don't you agree?
|
49
|
+
I mean, I would never...
|
50
|
+
[pause]
|
51
|
+
^ disagree with you.
|
52
|
+
But what if *i 45:09 tomorrow?
|
53
|
+
[turns away] You can't mean that!
|
54
|
+
```
|
55
|
+
|
56
|
+
Output:
|
57
|
+
```
|
58
|
+
Heathcliff: Hello there.
|
59
|
+
|
60
|
+
Cathy: Hello to you too.
|
61
|
+
|
62
|
+
Heathcliff: Lovely night on the moors.
|
63
|
+
[uncomfortable silence]
|
64
|
+
Cathy: This is splendid, don't you agree?
|
65
|
+
Heathcliff: I mean, I would never...
|
66
|
+
[pause]
|
67
|
+
Heathcliff: disagree with you.
|
68
|
+
Cathy: But what if [inaudible 45:09] tomorrow?
|
69
|
+
Heathcliff: [turns away] You can't mean that!
|
70
|
+
```
|
71
|
+
|
72
|
+
## Planned features:
|
13
73
|
- Accept multiple filenames
|
14
74
|
- Accept wildcard filenames
|
15
|
-
|
16
|
-
Expected format:
|
17
|
-
- File must be .txt
|
18
|
-
- Speakers of each line must alternate
|
19
|
-
- Lines that start with square brackets (stage directions) will be skipped
|
20
|
-
- Whitespace lines are skipped
|
75
|
+
- Support HH:MM:SS timestamps
|
21
76
|
|
22
77
|
## Installation
|
23
78
|
|
@@ -25,9 +80,9 @@ Expected format:
|
|
25
80
|
|
26
81
|
## Usage
|
27
82
|
|
28
|
-
$ tscripter filename.txt
|
83
|
+
$ tscripter filename.txt Heathcliff Cathy
|
29
84
|
|
30
|
-
|
85
|
+
`Heathcliff` and `Cathy` are the IDs to prepend.
|
31
86
|
|
32
87
|
## Development
|
33
88
|
|
data/lib/tscripter.rb
CHANGED
@@ -72,14 +72,14 @@ module Tscripter
|
|
72
72
|
|
73
73
|
def remove_markup(line)
|
74
74
|
if line[0] == '^'
|
75
|
-
line = line.slice(/\^\s(.*)/, 1)
|
75
|
+
line = line.slice(/\^\s*(.*)/, 1)
|
76
76
|
else
|
77
77
|
line
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
81
81
|
def add_inaudible_notation(line)
|
82
|
-
line.scan(/\*[iI]\s
|
82
|
+
line.scan(/\*[iI]\s*\d{1,2}\:\d{1,2}/) do |inaud_markup|
|
83
83
|
timestamp = inaud_markup.match(/(\d{1,2}\:\d{1,2})/)[1]
|
84
84
|
inaudible_notation = "[inaudible #{timestamp}]"
|
85
85
|
line = line.gsub(inaud_markup, inaudible_notation)
|
data/lib/tscripter/version.rb
CHANGED
data/test_input.txt
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
|
1
|
+
Hello there.
|
2
2
|
|
3
|
-
|
3
|
+
Hello to you too.
|
4
4
|
|
5
|
-
|
6
|
-
[
|
7
|
-
This is fun
|
8
|
-
I
|
9
|
-
|
10
|
-
^
|
5
|
+
I can't read books anymore.
|
6
|
+
[uncomfortable silence]
|
7
|
+
This is fun, don't you agree?
|
8
|
+
I mean, I would never...
|
9
|
+
[pause]
|
10
|
+
^ disagree with you.
|
11
11
|
But what if *i 45:09
|
12
12
|
[turns away] You can't really mean that!
|
13
13
|
|
data/tscripter-0.1.1.gem
ADDED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tscripter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- A. M.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -70,10 +70,10 @@ files:
|
|
70
70
|
- bin/console
|
71
71
|
- bin/setup
|
72
72
|
- bin/tscripter
|
73
|
-
- lib/test_input.txt
|
74
73
|
- lib/tscripter.rb
|
75
74
|
- lib/tscripter/version.rb
|
76
75
|
- test_input.txt
|
76
|
+
- tscripter-0.1.1.gem
|
77
77
|
- tscripter.gemspec
|
78
78
|
homepage: https://github.com/ichthala/tscripter
|
79
79
|
licenses:
|