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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd181dadc5d9128c27be3312f50274acffbcfce8
4
- data.tar.gz: 29fa12fb01c4409b7587496413b0fda0c46ab0a4
3
+ metadata.gz: 7b6348fb462dc7f40f7199c009882b589b3013f1
4
+ data.tar.gz: fcca5beda91ef23b2386e22367697e76d5e37428
5
5
  SHA512:
6
- metadata.gz: 188010cd203698454c7f2204c20e6a6e19a18a7eb25640d0c9555e011568ff87fe96ba521ab04c1c42975c59636e634992144a825980f9398abb12e72f913996
7
- data.tar.gz: ba9cf03f27fe8599815060771ea437fb852b95e0a5f3f1e06524e9ef0c5930b0a373c9fca08cbffd83c44b5238acd51403058775a83fe328a3550c7424cd88ee
6
+ metadata.gz: d46050f4b09475b2fb426b60551ce2a4f1dd9697878d131033e9ce53936336d7024a4ed102cdd307d6ca4533f0f40d134bd2781a931d11abc47f19bbc32be9d4
7
+ data.tar.gz: 8597872f8d75b6ad1c28e48e86aca55a727eb5f4237182af87d1eece9ddf7657831ad2b5463cdd67d2739e7fbcfc65c935858fddbb0b30f94a31591b769f613a
@@ -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!(/(?:\\\s|\n)/m) { '\s' }
18
- regexp.gsub!(/(?:\\s)+/m) {|s| 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
@@ -19,10 +19,8 @@ module Konjak
19
19
 
20
20
  def compile_pattern
21
21
  regexp = Regexp.escape(text)
22
- regexp = regexp.gsub(/(?:\\\s|\n)/m) { '\s' }
23
- regexp = regexp.gsub(/(?:\\s)+/m) {|s| s + '++' }
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
@@ -33,7 +33,7 @@ module Konjak
33
33
  end
34
34
 
35
35
  def strategy
36
- STRATEGIES[format].new(tmx, lang)
36
+ STRATEGIES[format].new(tmx, lang, @options)
37
37
  end
38
38
 
39
39
  end
@@ -37,9 +37,11 @@ module Konjak
37
37
  def segmentor(content)
38
38
  TmxSegmentor.new(
39
39
  content,
40
- tmx: tmx,
41
- lang: src_lang,
42
- format: format
40
+ options.merge({
41
+ tmx: tmx,
42
+ lang: src_lang,
43
+ format: format
44
+ })
43
45
  )
44
46
  end
45
47
 
@@ -1,3 +1,3 @@
1
1
  module Konjak
2
- VERSION = "0.0.13"
2
+ VERSION = "0.0.14"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: konjak
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seiei Higa