text_rank 1.2.4 → 1.3.1

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
  SHA256:
3
- metadata.gz: 57c44c7be2d14f3fb9d2b76212639c6f5416adedeb32e3c9d39a6b90368680bd
4
- data.tar.gz: 829bf430e9cc9dd942bdd753f801fc01d94929f42be09c6504691d47bc7c9f04
3
+ metadata.gz: 249809a9542815b7df91ccbf44c09c71c27056c8ffd433f01c07950aafee4900
4
+ data.tar.gz: 6d59f46f79abe151ff5b2a35f1965849d773bc4da853c25f5bde8bb5584239b4
5
5
  SHA512:
6
- metadata.gz: 7bdb293e07cca83ba7665cbe3861360cd3e4b82d64d5cd2167717e509bff6ccf14948436463464a9ab57f92cd97b8e7a918d27d004f3a7c476feb5c55565191f
7
- data.tar.gz: 446d28deeca6a972fc9b257b8699a859ec4fc481d6f04f31d02215d79a7251b87cfebeaba7335001e7977e974b72c3e79113c754d1749303dc943b3d59c6d62c
6
+ metadata.gz: bbd0aa099bde48e809246ecb2c08e6491c477fdf69c68556e6171ed6aff6541f56aeef99416d077cd68875e22c33af3b99b454659179aa8e515bf50ddf9636a4
7
+ data.tar.gz: 109825e24f9c030dd693202bb37f74cf7f6f096b8c53f0aed5978acac11f19d9dd3382adacf6d7dd419844c730f36468c4cf954fbff4a3dad0c22adef57eb627
data/.codeclimate.yml CHANGED
@@ -1,22 +1,32 @@
1
1
  ---
2
2
  engines:
3
+ cppcheck:
4
+ enabled: true
5
+ check: all
6
+ inline-suppr: true
7
+ language: c
3
8
  duplication:
4
9
  enabled: true
5
10
  config:
6
11
  languages:
12
+ - c
7
13
  - ruby
8
14
  checks:
9
15
  Similar code:
10
16
  enabled: false
11
17
  fixme:
12
18
  enabled: true
19
+ flog:
20
+ enabled: true
21
+ config:
22
+ score_threshold: 20.0
13
23
  rubocop:
14
24
  enabled: true
15
25
  exclude_fingerprints:
16
26
  - 4218049e28199ed950d3cd721df86dce
17
27
  - c8179d0de3a9df18a2c45750d3f8647e
18
28
  - 03f6eee11d86507da564695007106721
19
- channel: rubocop-0-85
29
+ channel: rubocop-1-23-0
20
30
  ratings:
21
31
  paths:
22
32
  - "**.rb"
@@ -0,0 +1,48 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ test:
11
+
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ ruby-version: ['3.0']
16
+
17
+ steps:
18
+ - uses: actions/checkout@v2
19
+ - name: Set up Ruby
20
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
21
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
22
+ # uses: ruby/setup-ruby@v1
23
+ uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
24
+ with:
25
+ ruby-version: ${{ matrix.ruby-version }}
26
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
27
+ - name: Compile native extensions
28
+ run: bundle exec rake clobber compile
29
+ - name: Run tests
30
+ run: bundle exec rake spec
31
+ - name: Rubocop
32
+ run: bundle exec rubocop
33
+ - name: cppcheck
34
+ uses: deep5050/cppcheck-action@main
35
+ with:
36
+ github_token: ${{ secrets.GITHUB_TOKEN}}
37
+ enable: all
38
+ exclude_check: ./vendor
39
+ force_language: c
40
+ inline_suppression: enable
41
+ other_options: --suppress=missingIncludeSystem
42
+ - name: Send coverage to Code Climate
43
+ uses: paambaati/codeclimate-action@v3.0.0
44
+ env:
45
+ CC_TEST_REPORTER_ID: 6ab030bf370ffc2abbf0ba4d70a1c8d9649f6fd1426f48f6d43d5c9eb15f187f
46
+ with:
47
+ coverageLocations: ${{github.workspace}}/coverage/coverage.json:simplecov
48
+ coverageCommand: bundle exec rake coverage
data/.gitignore CHANGED
@@ -8,3 +8,7 @@
8
8
  /pkg/
9
9
  /spec/reports/
10
10
  /tmp/
11
+
12
+
13
+ *.bundle
14
+ *.so
data/.rubocop.yml CHANGED
@@ -1,142 +1,202 @@
1
1
  AllCops:
2
2
  Exclude:
3
- - text_rank.gemspec
4
- - Rakefile
5
-
3
+ - ext/**/*
4
+ - tmp/**/*
5
+ - vendor/**/*
6
+ Gemspec/DateAssignment:
7
+ Enabled: true
8
+ Gemspec/RequireMFA:
9
+ Enabled: true
6
10
  Layout/EmptyLinesAroundAttributeAccessor:
7
11
  Enabled: true
8
-
9
12
  Layout/EmptyLinesAroundClassBody:
10
13
  EnforcedStyle: empty_lines_except_namespace
11
-
12
14
  Layout/EmptyLinesAroundModuleBody:
13
15
  EnforcedStyle: empty_lines_except_namespace
14
-
15
16
  Layout/ExtraSpacing:
16
17
  Enabled: false
17
-
18
18
  Layout/HashAlignment:
19
19
  EnforcedHashRocketStyle: table
20
20
  EnforcedColonStyle: table
21
-
21
+ Layout/LineEndStringConcatenationIndentation:
22
+ Enabled: true
22
23
  Layout/LineLength:
23
24
  Max: 120
24
25
  Enabled: false
25
-
26
26
  Layout/SpaceAroundMethodCallOperator:
27
27
  Enabled: true
28
-
28
+ Layout/SpaceBeforeBrackets:
29
+ Enabled: true
30
+ Lint/AmbiguousAssignment:
31
+ Enabled: true
32
+ Lint/AmbiguousOperatorPrecedence:
33
+ Enabled: true
34
+ Lint/AmbiguousRange:
35
+ Enabled: true
36
+ Lint/DeprecatedConstants:
37
+ Enabled: true
29
38
  Lint/DeprecatedOpenSSLConstant:
30
39
  Enabled: true
31
-
40
+ Lint/DuplicateBranch:
41
+ Enabled: true
42
+ Lint/DuplicateRegexpCharacterClassElement:
43
+ Enabled: true
44
+ Lint/EmptyBlock:
45
+ Enabled: true
46
+ Lint/EmptyClass:
47
+ Enabled: true
48
+ Lint/EmptyInPattern:
49
+ Enabled: true
50
+ Lint/IncompatibleIoSelectWithFiberScheduler:
51
+ Enabled: true
52
+ Lint/LambdaWithoutLiteralBlock:
53
+ Enabled: true
32
54
  Lint/MixedRegexpCaptureTypes:
33
55
  Enabled: true
34
-
56
+ Lint/NoReturnInBeginEndBlocks:
57
+ Enabled: true
58
+ Lint/NumberedParameterAssignment:
59
+ Enabled: true
60
+ Lint/OrAssignmentToConstant:
61
+ Enabled: true
35
62
  Lint/RaiseException:
36
63
  Enabled: true
37
-
64
+ Lint/RedundantDirGlobSort:
65
+ Enabled: true
66
+ Lint/RequireRelativeSelfPath:
67
+ Enabled: true
38
68
  Lint/StructNewOverride:
39
69
  Enabled: true
40
-
70
+ Lint/SymbolConversion:
71
+ Enabled: true
72
+ Lint/ToEnumArguments:
73
+ Enabled: true
74
+ Lint/TripleQuotes:
75
+ Enabled: true
76
+ Lint/UnexpectedBlockArity:
77
+ Enabled: true
78
+ Lint/UnmodifiedReduceAccumulator:
79
+ Enabled: true
80
+ Lint/UselessRuby2Keywords:
81
+ Enabled: true
41
82
  Metrics/AbcSize:
42
83
  Max: 50
43
84
  Enabled: false
44
-
45
85
  Metrics/BlockLength:
46
86
  Max: 50
47
87
  Enabled: false
48
-
49
88
  Metrics/ClassLength:
50
89
  Max: 50
51
90
  Enabled: false
52
-
53
91
  Metrics/CyclomaticComplexity:
54
92
  Max: 30
55
93
  Enabled: false
56
-
57
94
  Metrics/MethodLength:
58
95
  Max: 20
59
96
  Enabled: false
60
-
61
97
  Metrics/ModuleLength:
62
98
  Max: 1000
63
99
  Enabled: false
64
-
65
100
  Metrics/PerceivedComplexity:
66
101
  Max: 30
67
102
  Enabled: false
68
-
103
+ Naming/BlockForwarding:
104
+ Enabled: true
105
+ Security/IoMethods:
106
+ Enabled: true
69
107
  Security/MarshalLoad:
70
108
  Enabled: false
71
-
72
109
  Style/AndOr:
73
110
  Enabled: false
74
-
111
+ Style/ArgumentsForwarding:
112
+ Enabled: true
75
113
  Style/CaseEquality:
76
114
  Enabled: false
77
-
115
+ Style/CollectionCompact:
116
+ Enabled: true
117
+ Style/DocumentDynamicEvalDefinition:
118
+ Enabled: true
78
119
  Style/Documentation:
79
120
  Enabled: false
80
-
81
121
  Style/DoubleNegation:
82
122
  Enabled: false
83
-
123
+ Style/EndlessMethod:
124
+ Enabled: true
84
125
  Style/ExponentialNotation:
85
126
  Enabled: true
86
-
127
+ Style/FileRead:
128
+ Enabled: true
129
+ Style/FileWrite:
130
+ Enabled: true
87
131
  Style/FrozenStringLiteralComment:
88
132
  Enabled: false
89
-
90
133
  Style/GuardClause:
91
134
  Enabled: false
92
-
135
+ Style/HashConversion:
136
+ Enabled: true
93
137
  Style/HashEachMethods:
94
138
  Enabled: true
95
-
139
+ Style/HashExcept:
140
+ Enabled: true
96
141
  Style/HashSyntax:
97
142
  Enabled: true
98
-
99
143
  Style/HashTransformKeys:
100
144
  Enabled: true
101
-
102
145
  Style/HashTransformValues:
103
146
  Enabled: true
104
-
105
147
  Style/IfUnlessModifier:
106
148
  Enabled: false
107
-
149
+ Style/IfWithBooleanLiteralBranches:
150
+ Enabled: true
151
+ Style/InPatternThen:
152
+ Enabled: true
153
+ Style/MapToHash:
154
+ Enabled: true
108
155
  Style/MultilineBlockChain:
109
156
  Enabled: false
110
-
111
157
  Style/MultilineIfModifier:
112
158
  Enabled: false
113
-
159
+ Style/MultilineInPatternThen:
160
+ Enabled: true
114
161
  Style/MutableConstant:
115
162
  Enabled: false
116
-
163
+ Style/NegatedIfElseCondition:
164
+ Enabled: true
165
+ Style/NilLambda:
166
+ Enabled: true
167
+ Style/NumberedParameters:
168
+ Enabled: true
169
+ Style/NumberedParametersLimit:
170
+ Enabled: true
171
+ Style/OpenStructUse:
172
+ Enabled: true
173
+ Style/QuotedSymbols:
174
+ Enabled: true
175
+ Style/RedundantArgument:
176
+ Enabled: true
117
177
  Style/RedundantRegexpCharacterClass:
118
178
  Enabled: true
119
-
120
179
  Style/RedundantRegexpEscape:
121
180
  Enabled: true
122
-
181
+ Style/RedundantSelfAssignmentBranch:
182
+ Enabled: true
123
183
  Style/RescueModifier:
124
184
  Enabled: false
125
-
126
185
  Style/RescueStandardError:
127
186
  Enabled: false
128
-
187
+ Style/SelectByRegexp:
188
+ Enabled: true
129
189
  Style/SlicingWithRange:
130
190
  Enabled: true
131
-
191
+ Style/StringChars:
192
+ Enabled: true
193
+ Style/SwapValues:
194
+ Enabled: true
132
195
  Style/TrailingCommaInArguments:
133
196
  EnforcedStyleForMultiline: comma
134
-
135
197
  Style/TrailingCommaInArrayLiteral:
136
198
  EnforcedStyleForMultiline: consistent_comma
137
-
138
199
  Style/TrailingCommaInHashLiteral:
139
200
  EnforcedStyleForMultiline: consistent_comma
140
-
141
201
  Style/ZeroLengthPredicate:
142
202
  Enabled: false
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.5.1
1
+ ruby-3.0.3
data/.yardopts ADDED
@@ -0,0 +1,6 @@
1
+ --readme README.md
2
+ --title 'TextRank Documentation'
3
+ --charset utf-8
4
+ --markup-provider=redcarpet
5
+ --markup markdown
6
+ 'lib/**/*.rb' - '*.md'
data/CODE_OF_CONDUCT.md CHANGED
@@ -1,49 +1,133 @@
1
- # Contributor Code of Conduct
2
1
 
3
- As contributors and maintainers of this project, and in the interest of
4
- fostering an open and welcoming community, we pledge to respect all people who
5
- contribute through reporting issues, posting feature requests, updating
6
- documentation, submitting pull requests or patches, and other activities.
2
+ # Contributor Covenant Code of Conduct
7
3
 
8
- We are committed to making participation in this project a harassment-free
9
- experience for everyone, regardless of level of experience, gender, gender
10
- identity and expression, sexual orientation, disability, personal appearance,
11
- body size, race, ethnicity, age, religion, or nationality.
4
+ ## Our Pledge
12
5
 
13
- Examples of unacceptable behavior by participants include:
6
+ We as members, contributors, and leaders pledge to make participation in our
7
+ community a harassment-free experience for everyone, regardless of age, body
8
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
9
+ identity and expression, level of experience, education, socio-economic status,
10
+ nationality, personal appearance, race, caste, color, religion, or sexual
11
+ identity and orientation.
14
12
 
15
- * The use of sexualized language or imagery
16
- * Personal attacks
17
- * Trolling or insulting/derogatory comments
13
+ We pledge to act and interact in ways that contribute to an open, welcoming,
14
+ diverse, inclusive, and healthy community.
15
+
16
+ ## Our Standards
17
+
18
+ Examples of behavior that contributes to a positive environment for our
19
+ community include:
20
+
21
+ * Demonstrating empathy and kindness toward other people
22
+ * Being respectful of differing opinions, viewpoints, and experiences
23
+ * Giving and gracefully accepting constructive feedback
24
+ * Accepting responsibility and apologizing to those affected by our mistakes,
25
+ and learning from the experience
26
+ * Focusing on what is best not just for us as individuals, but for the overall
27
+ community
28
+
29
+ Examples of unacceptable behavior include:
30
+
31
+ * The use of sexualized language or imagery, and sexual attention or advances of
32
+ any kind
33
+ * Trolling, insulting or derogatory comments, and personal or political attacks
18
34
  * Public or private harassment
19
- * Publishing other's private information, such as physical or electronic
20
- addresses, without explicit permission
21
- * Other unethical or unprofessional conduct
35
+ * Publishing others' private information, such as a physical or email address,
36
+ without their explicit permission
37
+ * Other conduct which could reasonably be considered inappropriate in a
38
+ professional setting
39
+
40
+ ## Enforcement Responsibilities
41
+
42
+ Community leaders are responsible for clarifying and enforcing our standards of
43
+ acceptable behavior and will take appropriate and fair corrective action in
44
+ response to any behavior that they deem inappropriate, threatening, offensive,
45
+ or harmful.
22
46
 
23
- Project maintainers have the right and responsibility to remove, edit, or
24
- reject comments, commits, code, wiki edits, issues, and other contributions
25
- that are not aligned to this Code of Conduct, or to ban temporarily or
26
- permanently any contributor for other behaviors that they deem inappropriate,
27
- threatening, offensive, or harmful.
47
+ Community leaders have the right and responsibility to remove, edit, or reject
48
+ comments, commits, code, wiki edits, issues, and other contributions that are
49
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
50
+ decisions when appropriate.
28
51
 
29
- By adopting this Code of Conduct, project maintainers commit themselves to
30
- fairly and consistently applying these principles to every aspect of managing
31
- this project. Project maintainers who do not follow or enforce the Code of
32
- Conduct may be permanently removed from the project team.
52
+ ## Scope
33
53
 
34
- This code of conduct applies both within project spaces and in public spaces
35
- when an individual is representing the project or its community.
54
+ This Code of Conduct applies within all community spaces, and also applies when
55
+ an individual is officially representing the community in public spaces.
56
+ Examples of representing our community include using an official e-mail address,
57
+ posting via an official social media account, or acting as an appointed
58
+ representative at an online or offline event.
59
+
60
+ ## Enforcement
36
61
 
37
62
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
- reported by contacting a project maintainer at david@bloomfire.com. All
39
- complaints will be reviewed and investigated and will result in a response that
40
- is deemed necessary and appropriate to the circumstances. Maintainers are
41
- obligated to maintain confidentiality with regard to the reporter of an
42
- incident.
63
+ reported to the community leaders responsible for enforcement at
64
+ [INSERT CONTACT METHOD].
65
+ All complaints will be reviewed and investigated promptly and fairly.
66
+
67
+ All community leaders are obligated to respect the privacy and security of the
68
+ reporter of any incident.
69
+
70
+ ## Enforcement Guidelines
71
+
72
+ Community leaders will follow these Community Impact Guidelines in determining
73
+ the consequences for any action they deem in violation of this Code of Conduct:
74
+
75
+ ### 1. Correction
76
+
77
+ **Community Impact**: Use of inappropriate language or other behavior deemed
78
+ unprofessional or unwelcome in the community.
79
+
80
+ **Consequence**: A private, written warning from community leaders, providing
81
+ clarity around the nature of the violation and an explanation of why the
82
+ behavior was inappropriate. A public apology may be requested.
83
+
84
+ ### 2. Warning
85
+
86
+ **Community Impact**: A violation through a single incident or series of
87
+ actions.
88
+
89
+ **Consequence**: A warning with consequences for continued behavior. No
90
+ interaction with the people involved, including unsolicited interaction with
91
+ those enforcing the Code of Conduct, for a specified period of time. This
92
+ includes avoiding interactions in community spaces as well as external channels
93
+ like social media. Violating these terms may lead to a temporary or permanent
94
+ ban.
95
+
96
+ ### 3. Temporary Ban
97
+
98
+ **Community Impact**: A serious violation of community standards, including
99
+ sustained inappropriate behavior.
100
+
101
+ **Consequence**: A temporary ban from any sort of interaction or public
102
+ communication with the community for a specified period of time. No public or
103
+ private interaction with the people involved, including unsolicited interaction
104
+ with those enforcing the Code of Conduct, is allowed during this period.
105
+ Violating these terms may lead to a permanent ban.
106
+
107
+ ### 4. Permanent Ban
108
+
109
+ **Community Impact**: Demonstrating a pattern of violation of community
110
+ standards, including sustained inappropriate behavior, harassment of an
111
+ individual, or aggression toward or disparagement of classes of individuals.
112
+
113
+ **Consequence**: A permanent ban from any sort of public interaction within the
114
+ community.
115
+
116
+ ## Attribution
43
117
 
44
118
  This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
- version 1.3.0, available at
46
- [http://contributor-covenant.org/version/1/3/0/][version]
119
+ version 2.1, available at
120
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
121
+
122
+ Community Impact Guidelines were inspired by
123
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124
+
125
+ For answers to common questions about this code of conduct, see the FAQ at
126
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
127
+ [https://www.contributor-covenant.org/translations][translations].
47
128
 
48
- [homepage]: http://contributor-covenant.org
49
- [version]: http://contributor-covenant.org/version/1/3/0/
129
+ [homepage]: https://www.contributor-covenant.org
130
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
131
+ [Mozilla CoC]: https://github.com/mozilla/diversity
132
+ [FAQ]: https://www.contributor-covenant.org/faq
133
+ [translations]: https://www.contributor-covenant.org/translations
data/README.md CHANGED
@@ -8,9 +8,10 @@
8
8
  ## Status
9
9
 
10
10
  [![Gem Version](https://badge.fury.io/rb/text_rank.svg)](https://badge.fury.io/rb/text_rank)
11
- [![Travis Build Status](https://travis-ci.org/david-mccullars/text_rank.svg?branch=master)](https://travis-ci.org/david-mccullars/text_rank)
11
+ [![Build Status](https://github.com/david-mccullars/text_rank/workflows/CI/badge.svg)](https://github.com/david-mccullars/text_rank/actions?workflow=CI)
12
12
  [![Code Climate](https://codeclimate.com/github/david-mccullars/text_rank/badges/gpa.svg)](https://codeclimate.com/github/david-mccullars/text_rank)
13
13
  [![Test Coverage](https://codeclimate.com/github/david-mccullars/text_rank/badges/coverage.svg)](https://codeclimate.com/github/david-mccullars/text_rank/coverage)
14
+ [![MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
14
15
 
15
16
 
16
17
  ## Description
@@ -45,7 +46,7 @@ gem install text_rank
45
46
 
46
47
  ## Requirements
47
48
 
48
- * Ruby 2.1.2 or higher
49
+ * Ruby 3.0.0 or higher
49
50
  * [engtagger](https://github.com/yohasebe/engtagger) gem is optional but
50
51
  required for `TextRank::TokenFilter::PartOfSpeech`
51
52
  * [nokogiri](https://github.com/sparklemotion/nokogiri) gem is optional but
@@ -82,7 +83,7 @@ extractor = TextRank::KeywordExtractor.new(
82
83
  damping: 0.85, # The probability of following the graph vs. randomly choosing a new node
83
84
  tolerance: 0.0001, # The desired accuracy of the results
84
85
  char_filters: [...], # A list of filters to be applied prior to tokenization
85
- tokenizer: ..., # A class or tokenizer instance to perform tokenization
86
+ tokenizers: [...], # A list of tokenizers to perform tokenization
86
87
  token_filters: [...], # A list of filters to be applied to each token after tokenization
87
88
  graph_strategy: ..., # A class or strategy instance for producing a graph from tokens
88
89
  rank_filters: [...], # A list of filters to be applied to the keyword ranks after keyword extraction
data/Rakefile CHANGED
@@ -1,12 +1,14 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/extensiontask'
3
+ require 'rspec/core/rake_task'
4
+ require 'yard'
3
5
 
4
6
  RSpec::Core::RakeTask.new(:spec)
5
7
 
6
- task :default => :spec
8
+ task default: :spec
7
9
 
8
- require 'rdoc/task'
9
- RDoc::Task.new do |rdoc|
10
- rdoc.main = "README.md"
11
- rdoc.rdoc_files.include("README.md", "lib/**/*.rb")
10
+ YARD::Rake::YardocTask.new
11
+
12
+ Rake::ExtensionTask.new('text_rank') do |ext|
13
+ ext.lib_dir = 'lib/text_rank'
12
14
  end
@@ -0,0 +1,3 @@
1
+ require "mkmf"
2
+
3
+ create_makefile('text_rank/text_rank')