engtagger 0.4.1 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe357706e69ed72bec9569babe91cc8531e2c1d0eac71ac8d248bdd74b97ba98
4
- data.tar.gz: 02e6bb2ba29ecabf8e5087c5a2dc92ccad57ef3578fbd9c844f93188a4d39ced
3
+ metadata.gz: 688eb41815586b529212a5451966f0cb2a1f4027c8aeb1c949fb437f1c8e5b4a
4
+ data.tar.gz: 1c7eea0dccc4c52133506220861c3ccce512d84f75df10060419dce5d24dfb8f
5
5
  SHA512:
6
- metadata.gz: 5e477b0d839e825e8d49135cb6d6c72c21555454d6f722d00b994442cdaaba2b1afa84ab8f22f82f64b9540a0e24914180c59a563830ea11b2a0239921d3e88e
7
- data.tar.gz: 49b02532d7ad940b25b19ba59df364fc553373371f7850f068729af3a339773417ad7f8d5e0e58ecc3facc6ef2168ae86bb9f94a46f9a412bf51d7de36fdab1e
6
+ metadata.gz: 3e5d673b7dd49cbe468c915e247f7d7e6b13002dc1b67e4e98c4e2d9066165f6cc6e0426d1393ff2711a4fb9df1294e44e9dbfc4c89e2b685b32a49482cd68c6
7
+ data.tar.gz: 609562c6c5cc2ea37762ff27e16a8689d569389eb9bf31af413d702e421a78d47acc8bdf993a1acffdce19631c565ca3452f371936f005e395db7f930933695e
data/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ # Changelog
2
+
3
+ ## 0.4.3
4
+
5
+ - Fix gem packaging that produced files with owner-only (0600) permissions,
6
+ making the gem unreadable after a `sudo gem install` (#20). File permissions
7
+ are now normalized before packaging.
8
+ - Restore lost debug output in `valid_text` (a remnant of the Perl port left
9
+ the message string in void context).
10
+ - Clarify that the VBG tag covers both gerunds and present participles, as in
11
+ the Penn Treebank tagset (#19).
12
+ - Minor RuboCop cleanups.
13
+
14
+ ## 0.4.2 and earlier
15
+
16
+ See the [commit history](https://github.com/yohasebe/engtagger/commits/master).
data/Gemfile CHANGED
@@ -4,4 +4,6 @@ source "https://rubygems.org"
4
4
 
5
5
  gemspec
6
6
 
7
- gem "lru_redux"
7
+ gem "rake"
8
+ gem "sin_lru_redux"
9
+ gem "test-unit"
data/README.md CHANGED
@@ -104,7 +104,7 @@ The set of POS tags used here is a modified version of the Penn Treebank tagset.
104
104
  UH Interjection oh, yes, mmm
105
105
  VB Verb, infinitive take, live
106
106
  VBD Verb, past tense took, lived
107
- VBG Verb, gerund taking, living
107
+ VBG Verb, gerund or present participle taking, living
108
108
  VBN Verb, past/passive participle taken, lived
109
109
  VBP Verb, base present form take, live
110
110
  VBZ Verb, present 3SG -s form takes, lives
@@ -147,7 +147,7 @@ sudo gem install engtagger
147
147
  2. Grant necessary permissions to your user:
148
148
 
149
149
  ```bash
150
- sudo chown -R $(whoami) /Library/Ruby/Gems/2.6.0/gems/engtagger-0.4.1
150
+ sudo chown -R $(whoami) /Library/Ruby/Gems/2.6.0/gems/engtagger-0.4.2
151
151
  ```
152
152
 
153
153
  **Note:** The path above assumes you are using Ruby version 2.6.0. If you are using a different version, you will need to modify the path accordingly. You can find your Ruby version by running `ruby -v`.
data/Rakefile CHANGED
@@ -8,3 +8,13 @@ Rake::TestTask.new do |t|
8
8
  t.test_files = FileList["test/test*.rb"]
9
9
  t.verbose = true
10
10
  end
11
+
12
+ # Gem packaging preserves on-disk file modes; owner-only permissions here
13
+ # produce gems whose files are unreadable after a sudo install (issue #20).
14
+ task :normalize_permissions do
15
+ `git ls-files -z`.split("\x0").each do |f|
16
+ File.chmod(File.executable?(f) ? 0o755 : 0o644, f)
17
+ end
18
+ end
19
+
20
+ Rake::Task["build"].enhance([:normalize_permissions])
data/engtagger.gemspec CHANGED
@@ -18,5 +18,5 @@ Gem::Specification.new do |gem|
18
18
  gem.name = "engtagger"
19
19
  gem.require_paths = ["lib"]
20
20
  gem.version = EngTagger::VERSION
21
- gem.add_dependency "lru_redux"
21
+ gem.add_dependency "sin_lru_redux"
22
22
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class EngTagger
4
- VERSION = "0.4.1"
4
+ VERSION = "0.4.3"
5
5
  end
data/lib/engtagger.rb CHANGED
@@ -12,7 +12,7 @@ module BoundedSpaceMemoizable
12
12
  alias_method "__memoized__#{method}", method
13
13
  module_eval <<-MODEV
14
14
  def #{method}(*a)
15
- @__memoized_#{method}_cache ||= LruRedux::Cache.new(#{max_cache_size})
15
+ @__memoized_#{method}_cache ||= LruRedux::Cache.new(#{max_cache_size}, true)
16
16
  @__memoized_#{method}_cache[a] ||= __memoized__#{method}(*a)
17
17
  end
18
18
  MODEV
@@ -128,7 +128,7 @@ class EngTagger
128
128
  "UH", "Interjection",
129
129
  "VB", "Verb, infinitive",
130
130
  "VBD", "Verb, past tense",
131
- "VBG", "Verb, gerund",
131
+ "VBG", "Verb, gerund or present participle",
132
132
  "VBN", "Verb, past/passive participle",
133
133
  "VBP", "Verb, base present form",
134
134
  "VBZ", "Verb, present 3SG -s form",
@@ -645,7 +645,7 @@ class EngTagger
645
645
  def valid_text(text)
646
646
  if !text
647
647
  # there's nothing to parse
648
- "method call on uninitialized variable" if @conf[:debug]
648
+ puts "method call on uninitialized variable" if @conf[:debug]
649
649
  false
650
650
  elsif /\A\s*\z/ =~ text
651
651
  # text is an empty string, nothing to parse
@@ -839,7 +839,7 @@ class EngTagger
839
839
  when /\w-\w/o # Hyphenated word
840
840
  /-([^-]+)\z/ =~ word
841
841
  h_suffix = $1
842
- if h_suffix && (@@lexicon[h_suffix] && @@lexicon[h_suffix]["jj"])
842
+ if h_suffix && @@lexicon[h_suffix] && @@lexicon[h_suffix]["jj"]
843
843
  # last part of this is defined as an adjective
844
844
  "-hyp-adj-"
845
845
  else
metadata CHANGED
@@ -1,17 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: engtagger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoichiro Hasebe
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-04-30 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
- name: lru_redux
13
+ name: sin_lru_redux
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - ">="
@@ -37,6 +36,7 @@ files:
37
36
  - ".rubocop.yml"
38
37
  - ".solargraph.yml"
39
38
  - ".yardopts"
39
+ - CHANGELOG.md
40
40
  - Gemfile
41
41
  - LICENSE
42
42
  - README.md
@@ -54,7 +54,6 @@ homepage: http://github.com/yohasebe/engtagger
54
54
  licenses:
55
55
  - GPL
56
56
  metadata: {}
57
- post_install_message:
58
57
  rdoc_options: []
59
58
  require_paths:
60
59
  - lib
@@ -69,8 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
68
  - !ruby/object:Gem::Version
70
69
  version: '0'
71
70
  requirements: []
72
- rubygems_version: 3.4.12
73
- signing_key:
71
+ rubygems_version: 3.6.9
74
72
  specification_version: 4
75
73
  summary: A probability based, corpus-trained English POS tagger
76
74
  test_files: []