vn_tagger 0.2.2 → 0.2.3

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: a3e2987fc2377226b3a310d0ea144414b1fcb409
4
- data.tar.gz: 67c6119fd7a08e03ce1fde5e06545f8756ecfac3
3
+ metadata.gz: 84f36faab822edc3bd0f8da9866d7d75f6d1b554
4
+ data.tar.gz: 70ca20e6ed8213c4eab31a6e56bdbe59aeee08db
5
5
  SHA512:
6
- metadata.gz: f8c8f43645f90f41cbcc34409e7e3d50afa24f550c072ffaf2c3dd67c2417d56ccab24b1029ece8f331c42e634d889f2950ed2955fafefaddee7a6dc02fc2e7b
7
- data.tar.gz: afbb54e8772ec8d12c3449b11c47d26e3b83c30245168cb3a1716a6d6adf645f4a69e4bd594317416338ddee948ecafa2e2ed8751156282992d674e13015c169
6
+ metadata.gz: f5e264b5025363ca6e33cb9afb3ef9cccac0354b2cf3daae24c739380b339310bf9a1d9e23fa76c10dd33a30a0ebedfe236ca2b3d1d832ba0c55640e8b9df18a
7
+ data.tar.gz: e3ffef06bb2d7b4de87e9e9c640645997df4edb138a56619810f689015da001c5ccc3eb79746766cdab72877c40dc7588e4e884d1eff8508e7d37764dd964b4f
@@ -0,0 +1,7 @@
1
+ nguage: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 2.1.0
5
+ - 2.2.0
6
+
7
+ script: bundle exec rspec spec
@@ -18,16 +18,13 @@ module VnTagger
18
18
  end
19
19
 
20
20
  def xml_result
21
- @xml_result ||= if is_success?
22
- file = File.open(OUTPUT)
23
- xml_document = Nokogiri::XML(file)
24
- file.close
25
- File.delete(OUTPUT)
26
- xml_document
27
- else
28
- File.delete(OUTPUT)
29
- Nokogiri::XML('')
30
- end
21
+ @xml_result ||= uncached_xml_result
22
+ end
23
+
24
+ def uncached_xml_result
25
+ xml_document = is_success? ? read_xml_document : blank_xml_document
26
+ delete_output
27
+ xml_document
31
28
  end
32
29
 
33
30
  def result
@@ -42,8 +39,12 @@ module VnTagger
42
39
 
43
40
  private
44
41
 
42
+ def output_exist?
43
+ File.exists?(OUTPUT)
44
+ end
45
+
45
46
  def is_success?
46
- @success && File.exists?(OUTPUT)
47
+ @success && output_exist?
47
48
  end
48
49
 
49
50
  def write_to_file
@@ -55,5 +56,22 @@ module VnTagger
55
56
  def normalize(string)
56
57
  string.to_s.gsub(/(\"|\')/, '')
57
58
  end
59
+
60
+ def blank_xml_document
61
+ Nokogiri::XML('')
62
+ end
63
+
64
+ def read_xml_document
65
+ file = File.open(OUTPUT)
66
+ xml_document = Nokogiri::XML(file)
67
+ file.close
68
+ xml_document
69
+ end
70
+
71
+ def delete_output
72
+ if output_exist?
73
+ File.delete(OUTPUT)
74
+ end
75
+ end
58
76
  end
59
77
  end
@@ -1,3 +1,3 @@
1
1
  module VnTagger
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.version = VnTagger::VERSION
9
9
  spec.authors = ["Hieu Nguyen"]
10
10
  spec.email = ["hieuk09@gmail.com"]
11
- spec.summary = %q{This is a wrapper for vn_tagger library, a A POS tagger for Vietnamese texts. }
12
- spec.description = %q{This is a wrapper for vn_tagger library, a A POS tagger for Vietnamese texts. }
11
+ spec.summary = %q{This is a wrapper for vn_tagger library, a POS tagger for Vietnamese text. }
12
+ spec.description = %q{This is a wrapper for vn_tagger library, a POS tagger for Vietnamese text. }
13
13
  spec.homepage = "https://github.com/hieuk09/ruby_vn_tagger"
14
14
  spec.license = "MIT"
15
15
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vn_tagger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hieu Nguyen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-29 00:00:00.000000000 Z
11
+ date: 2015-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,8 +66,8 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description: 'This is a wrapper for vn_tagger library, a A POS tagger for Vietnamese
70
- texts. '
69
+ description: 'This is a wrapper for vn_tagger library, a POS tagger for Vietnamese
70
+ text. '
71
71
  email:
72
72
  - hieuk09@gmail.com
73
73
  executables: []
@@ -75,6 +75,7 @@ extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
77
  - ".gitignore"
78
+ - ".travis.yml"
78
79
  - Gemfile
79
80
  - LICENSE.txt
80
81
  - README.md
@@ -131,7 +132,7 @@ rubyforge_project:
131
132
  rubygems_version: 2.4.3
132
133
  signing_key:
133
134
  specification_version: 4
134
- summary: This is a wrapper for vn_tagger library, a A POS tagger for Vietnamese texts.
135
+ summary: This is a wrapper for vn_tagger library, a POS tagger for Vietnamese text.
135
136
  test_files:
136
137
  - spec/spec_helper.rb
137
138
  - spec/vn_tagger/document_spec.rb