txt_tm_importer 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/txt_tm_importer/version.rb +1 -1
- data/lib/txt_tm_importer.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: 183518e69c920f900df7dea5cb1eec51326810d5
|
4
|
+
data.tar.gz: 42982d9eccc4d4a45131aad78e953b8419604081
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21d6e665f9af1b7a4d0b8b190254829f807385bf8598f740cecfc9ab5c56f99945716c0941cc3a418642e6320a320cceb3add2f79c7fe258bc061d80b5afe531
|
7
|
+
data.tar.gz: 70832f13eaef1f44f1e2cc4f93bff2393f9e3ad3677d94644e312504fc6121e658557193728e12d92b52c29c443750d0e3e42e3bb2708bcdfa9d2b32a10e4b83
|
data/lib/txt_tm_importer.rb
CHANGED
@@ -79,6 +79,7 @@ module TxtTmImporter
|
|
79
79
|
next if index.eql?(0)
|
80
80
|
timestamp = create_timestamp(line.split("\t")[0])
|
81
81
|
@doc[:tu][:creation_date] = timestamp unless timestamp.nil?
|
82
|
+
generate_unique_id
|
82
83
|
write_tu
|
83
84
|
write_seg(remove_wordfast_tags(line_array[4]), 'source', line_array[3]) unless line_array[4].nil?
|
84
85
|
write_seg(remove_wordfast_tags(line_array[6]), 'target', line_array[5]) unless line_array[6].nil?
|
@@ -159,7 +160,6 @@ module TxtTmImporter
|
|
159
160
|
def write_seg(string, role, language)
|
160
161
|
return if string.nil?
|
161
162
|
text = PrettyStrings::Cleaner.new(string).pretty.gsub("\\","\").gsub("'",%q(\\\'))
|
162
|
-
return if text.nil? || text.empty?
|
163
163
|
word_count = text.gsub("\s+", ' ').split(' ').length
|
164
164
|
@doc[:seg][:vals] << [@doc[:tu][:id], role, word_count, language, text, @doc[:tu][:creation_date]]
|
165
165
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: txt_tm_importer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin S. Dias
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|