konjak 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/konjak/segment/gtt.rb +2 -4
- data/lib/konjak/segment.rb +2 -4
- data/lib/konjak/tmx_segmentor.rb +1 -1
- data/lib/konjak/translator.rb +5 -3
- data/lib/konjak/version.rb +1 -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: 7b6348fb462dc7f40f7199c009882b589b3013f1
|
4
|
+
data.tar.gz: fcca5beda91ef23b2386e22367697e76d5e37428
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d46050f4b09475b2fb426b60551ce2a4f1dd9697878d131033e9ce53936336d7024a4ed102cdd307d6ca4533f0f40d134bd2781a931d11abc47f19bbc32be9d4
|
7
|
+
data.tar.gz: 8597872f8d75b6ad1c28e48e86aca55a727eb5f4237182af87d1eece9ddf7657831ad2b5463cdd67d2739e7fbcfc65c935858fddbb0b30f94a31591b769f613a
|
data/lib/konjak/segment/gtt.rb
CHANGED
@@ -14,10 +14,8 @@ module Konjak
|
|
14
14
|
regexp.gsub!(/\\\{#{n}\\\}/) { "\\k<n#{n}>" }
|
15
15
|
regexp.gsub!(/\\\{\/#{n}\\\}/) { "</\\k<_#{n}>>" }
|
16
16
|
end
|
17
|
-
regexp.gsub!(
|
18
|
-
regexp.gsub!(/(?:\\s)
|
19
|
-
regexp.gsub!(/^(?<s>(?:\\s)+)\+\+/) { $~[:s] }
|
20
|
-
regexp.gsub!(/(?<s>(?:\\s)+)\+\+$/) { $~[:s] }
|
17
|
+
regexp.gsub!(/\\\s/) { '\s' }
|
18
|
+
regexp.gsub!(/(?<!^)(?:\\s)+(?!$)/) {|s| s + '++' }
|
21
19
|
Regexp.compile(regexp)
|
22
20
|
end
|
23
21
|
memoize :compile_gtt_html_pattern
|
data/lib/konjak/segment.rb
CHANGED
@@ -19,10 +19,8 @@ module Konjak
|
|
19
19
|
|
20
20
|
def compile_pattern
|
21
21
|
regexp = Regexp.escape(text)
|
22
|
-
regexp
|
23
|
-
regexp
|
24
|
-
regexp = regexp.gsub(/^(?<s>(?:\\s)+)\+\+/) { $~[:s] }
|
25
|
-
regexp = regexp.gsub(/(?<s>(?:\\s)+)\+\+$/) { $~[:s] }
|
22
|
+
regexp.gsub!(/(?<!^)\\\s/) { '\s' }
|
23
|
+
regexp.gsub!(/(?<!^)(?:\\s)+(?!$)/) {|s| s + '++' }
|
26
24
|
Regexp.compile(regexp)
|
27
25
|
end
|
28
26
|
memoize :compile_pattern
|
data/lib/konjak/tmx_segmentor.rb
CHANGED
data/lib/konjak/translator.rb
CHANGED
data/lib/konjak/version.rb
CHANGED