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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80153026db2ec8c225133763204dd46adca0d9a5
4
- data.tar.gz: a87966a879e69133342f0ce31faa6ce52436d848
3
+ metadata.gz: 183518e69c920f900df7dea5cb1eec51326810d5
4
+ data.tar.gz: 42982d9eccc4d4a45131aad78e953b8419604081
5
5
  SHA512:
6
- metadata.gz: 77ea7d6ec769241e3c99546189e0644d2801dcad0492ffa2ce0b8495974d38d1f42de420e4635d43667347985625bc1ef5fc3459096b93e67bd65fb09465b2c4
7
- data.tar.gz: c8d6bbdfa4d3ec95a0e986874a694ef50aec9590e75c6f35257a835be4ef3787de3e9a7f445c248622f13c4e1cb777f2c100ca59c004b43b06d0d4002279caec
6
+ metadata.gz: 21d6e665f9af1b7a4d0b8b190254829f807385bf8598f740cecfc9ab5c56f99945716c0941cc3a418642e6320a320cceb3add2f79c7fe258bc061d80b5afe531
7
+ data.tar.gz: 70832f13eaef1f44f1e2cc4f93bff2393f9e3ad3677d94644e312504fc6121e658557193728e12d92b52c29c443750d0e3e42e3bb2708bcdfa9d2b32a10e4b83
@@ -1,3 +1,3 @@
1
1
  module TxtTmImporter
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -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.2.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-15 00:00:00.000000000 Z
11
+ date: 2016-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler