sdltm_importer 0.1.0 → 0.2.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 +4 -4
- data/lib/sdltm_importer/version.rb +1 -1
- data/lib/sdltm_importer.rb +1 -1
- data/spec/sdltm_importer_spec.rb +7 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5d080567f5974f3da6d43c1a5e37e83189959302
|
|
4
|
+
data.tar.gz: bbe88864aa94cae644eb217725bf27d25b70a139
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: af1bc11feecdd54c8ca7d4d29591dad5dc0fd5bbc51b1e571bc95a83b4dd6d3dc9cbe5f3cb29bc2c961bae96f9e16bd4e7b2d8d3d0fc0c60655cb676d70b3c71
|
|
7
|
+
data.tar.gz: 8c0df97471e1dd9b89a2f66d9ab9af804a93fda3133598dfe088e0eab2988151609df93722998adc0cb4bb144259b412f069bc4444f736cf81c16eb5a196aecc
|
data/lib/sdltm_importer.rb
CHANGED
|
@@ -62,7 +62,7 @@ module SdltmImporter
|
|
|
62
62
|
[4, 6].each do |i|
|
|
63
63
|
language = segment[i].scan(TUV_LANG_REGEX).flatten[0]
|
|
64
64
|
tags = create_tags(segment[i].scan(TUV_TAGS_REGEX), segment, i)
|
|
65
|
-
segment_text = PrettyStrings::Cleaner.new(parse_segment_text(segment, tags, i)).pretty
|
|
65
|
+
segment_text = PrettyStrings::Cleaner.new(parse_segment_text(segment, tags, i)).pretty.gsub("\\","\").gsub("'",%q(\\\'))
|
|
66
66
|
word_count = segment_text.gsub("\s+", ' ').split(' ').length
|
|
67
67
|
if i.eql?(4)
|
|
68
68
|
@doc[:source_language] = language
|
data/spec/sdltm_importer_spec.rb
CHANGED
|
@@ -35,7 +35,7 @@ describe SdltmImporter do
|
|
|
35
35
|
it 'imports a .sdltm file 3' do
|
|
36
36
|
file_path = File.expand_path('../sdltm_importer/spec/sample_test_files/sample.sdltm')
|
|
37
37
|
sdltm = SdltmImporter::Sdltm.new(file_path: file_path)
|
|
38
|
-
expect(sdltm.import[1][-1][4]).to eq("Your website's URL")
|
|
38
|
+
expect(sdltm.import[1][-1][4]).to eq("Your website\\'s URL")
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
it 'imports a .sdltm file 4' do
|
|
@@ -61,5 +61,11 @@ describe SdltmImporter do
|
|
|
61
61
|
sdltm = SdltmImporter::Sdltm.new(file_path: file_path)
|
|
62
62
|
expect(sdltm.import[0][1][0]).to eq(sdltm.import[1][3][0])
|
|
63
63
|
end
|
|
64
|
+
|
|
65
|
+
it 'imports a .sdltm file 7' do
|
|
66
|
+
file_path = File.expand_path('../sdltm_importer/spec/sample_test_files/sample.sdltm')
|
|
67
|
+
sdltm = SdltmImporter::Sdltm.new(file_path: file_path)
|
|
68
|
+
expect(sdltm.import[0][1][0]).to eq(sdltm.import[1][3][0])
|
|
69
|
+
end
|
|
64
70
|
end
|
|
65
71
|
end
|