konjak 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/konjak/tmx_segmentor/strategy.rb +15 -1
- data/lib/konjak/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d70121865e9191011c91bda6d7f522002ed9a097
|
4
|
+
data.tar.gz: d7c9e4825522184fb8d9fc574646c8781d8da403
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9c3bae89036245ab759caeedce55e8696478882bf0df34020fb1b62969bd83ba04f2a9d216917bf62f23c96fd2c7b18a517b41817d104aef3c6b14b341d3101
|
7
|
+
data.tar.gz: ca29b2f78c00738fba36cd380bea116bd381e3f3b76f6e131d68d0ce783913a36f8d01724726143057c5f0da6012e67214a3400b8850b2341d13331afcf6a7d8
|
@@ -62,7 +62,21 @@ module Konjak
|
|
62
62
|
|
63
63
|
def translation_units
|
64
64
|
@tmx.body.translation_units.sort_by {|tu|
|
65
|
-
|
65
|
+
# GTTの場合
|
66
|
+
translation_timestamp = nil
|
67
|
+
|
68
|
+
if tm_entry = tu.at('entry_metadata').try(:at, 'tm_entry')
|
69
|
+
source_info = tm_entry.at('source_info')
|
70
|
+
if source_info.try(:at, 'source_lang').try(:text) == @lang && source_info.try(:at, 'source').try(:text) == tu.variant(@lang).segment.text
|
71
|
+
translation_timestamp = tm_entry.at('translation').try(:attr, 'translation_timestamp').to_i
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
translation_timestamp ||= 0
|
76
|
+
|
77
|
+
segment_length = tu.variant(@lang).segment.text.length
|
78
|
+
|
79
|
+
[-translation_timestamp, -segment_length]
|
66
80
|
}.reject {|tu|
|
67
81
|
tu.variant(@lang).segment.text.length < min_segment_length
|
68
82
|
}
|
data/lib/konjak/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: konjak
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seiei Higa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mem
|
@@ -215,3 +215,4 @@ test_files:
|
|
215
215
|
- spec/konjak_translate_spec.rb
|
216
216
|
- spec/spec_helper.rb
|
217
217
|
- spec/support/equal_xml_matcher.rb
|
218
|
+
has_rdoc:
|