splitta 4.2.5 → 5.0.0
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 +4 -4
- data/.codeclimate.yml +10 -1
- data/.github/workflows/ci.yml +37 -0
- data/.gitignore +1 -0
- data/.rspec +2 -0
- data/.rubocop.yml +110 -43
- data/.ruby-version +1 -1
- data/.yardopts +6 -0
- data/CODE_OF_CONDUCT.md +120 -36
- data/README.md +2 -1
- data/Rakefile +19 -31
- data/bin/pickle2json +14 -0
- data/data/feats +0 -0
- data/data/lower_words +0 -0
- data/data/non_abbrs +0 -0
- data/lib/splitta/version.rb +1 -1
- data/splitta.gemspec +11 -2
- metadata +70 -11
- data/.travis.yml +0 -15
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4796446098b41660e0d2964aa4f07bab8eaf29604260fe62146168ccd1eb6f09
|
|
4
|
+
data.tar.gz: a0cdef7d9fe32d8326cd36f90efa2354e35a2f482df04f35e75db02b9c2f382f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8fa2ee2a00aa39b5185bd959cf93bc36a485ebd531ff6fe06eafe08e2651e46a707a04462638415217b8bbb95f545ad9d4d67a94a31f0de930ec8c525a76fe57
|
|
7
|
+
data.tar.gz: b2cbf956fba309f7131160a8ab44d8a5b24c80bce8765940b5a676b3c3d2c7e4d3dc18b0fafd4c4ddf128730eb7d9d126239af4353b4166aa1da96e7bd7e4428
|
data/.codeclimate.yml
CHANGED
|
@@ -4,15 +4,24 @@ engines:
|
|
|
4
4
|
enabled: true
|
|
5
5
|
config:
|
|
6
6
|
languages:
|
|
7
|
+
- c
|
|
7
8
|
- ruby
|
|
8
9
|
checks:
|
|
9
10
|
Similar code:
|
|
10
11
|
enabled: false
|
|
11
12
|
fixme:
|
|
12
13
|
enabled: true
|
|
14
|
+
flog:
|
|
15
|
+
enabled: true
|
|
16
|
+
config:
|
|
17
|
+
score_threshold: 20.0
|
|
13
18
|
rubocop:
|
|
14
19
|
enabled: true
|
|
15
|
-
|
|
20
|
+
exclude_fingerprints:
|
|
21
|
+
- 4218049e28199ed950d3cd721df86dce
|
|
22
|
+
- c8179d0de3a9df18a2c45750d3f8647e
|
|
23
|
+
- 03f6eee11d86507da564695007106721
|
|
24
|
+
channel: rubocop-1-23-0
|
|
16
25
|
ratings:
|
|
17
26
|
paths:
|
|
18
27
|
- "**.rb"
|
|
@@ -0,0 +1,37 @@
|
|
|
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: Run tests
|
|
28
|
+
run: bundle exec rake spec
|
|
29
|
+
- name: Rubocop
|
|
30
|
+
run: bundle exec rubocop
|
|
31
|
+
- name: Send coverage to Code Climate
|
|
32
|
+
uses: paambaati/codeclimate-action@v3.0.0
|
|
33
|
+
env:
|
|
34
|
+
CC_TEST_REPORTER_ID: 35dd438da367278dc0d80cb7e21b3b0cd6eb207f60890a05c3fe1f0882981e64
|
|
35
|
+
with:
|
|
36
|
+
coverageLocations: ${{github.workspace}}/coverage/coverage.json:simplecov
|
|
37
|
+
coverageCommand: bundle exec rake coverage
|
data/.gitignore
CHANGED
data/.rspec
ADDED
data/.rubocop.yml
CHANGED
|
@@ -1,135 +1,202 @@
|
|
|
1
1
|
AllCops:
|
|
2
2
|
Exclude:
|
|
3
|
-
|
|
4
|
-
|
|
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
|
+
Layout/HashAlignment:
|
|
19
|
+
EnforcedHashRocketStyle: table
|
|
20
|
+
EnforcedColonStyle: table
|
|
21
|
+
Layout/LineEndStringConcatenationIndentation:
|
|
22
|
+
Enabled: true
|
|
18
23
|
Layout/LineLength:
|
|
19
24
|
Max: 120
|
|
20
25
|
Enabled: false
|
|
21
|
-
|
|
22
26
|
Layout/SpaceAroundMethodCallOperator:
|
|
23
27
|
Enabled: true
|
|
24
|
-
|
|
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
|
|
25
38
|
Lint/DeprecatedOpenSSLConstant:
|
|
26
39
|
Enabled: true
|
|
27
|
-
|
|
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
|
|
28
54
|
Lint/MixedRegexpCaptureTypes:
|
|
29
55
|
Enabled: true
|
|
30
|
-
|
|
56
|
+
Lint/NoReturnInBeginEndBlocks:
|
|
57
|
+
Enabled: true
|
|
58
|
+
Lint/NumberedParameterAssignment:
|
|
59
|
+
Enabled: true
|
|
60
|
+
Lint/OrAssignmentToConstant:
|
|
61
|
+
Enabled: true
|
|
31
62
|
Lint/RaiseException:
|
|
32
63
|
Enabled: true
|
|
33
|
-
|
|
64
|
+
Lint/RedundantDirGlobSort:
|
|
65
|
+
Enabled: true
|
|
66
|
+
Lint/RequireRelativeSelfPath:
|
|
67
|
+
Enabled: true
|
|
34
68
|
Lint/StructNewOverride:
|
|
35
69
|
Enabled: true
|
|
36
|
-
|
|
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
|
|
37
82
|
Metrics/AbcSize:
|
|
38
83
|
Max: 50
|
|
39
84
|
Enabled: false
|
|
40
|
-
|
|
41
85
|
Metrics/BlockLength:
|
|
42
86
|
Max: 50
|
|
43
87
|
Enabled: false
|
|
44
|
-
|
|
45
88
|
Metrics/ClassLength:
|
|
46
89
|
Max: 50
|
|
47
90
|
Enabled: false
|
|
48
|
-
|
|
49
91
|
Metrics/CyclomaticComplexity:
|
|
50
92
|
Max: 30
|
|
51
93
|
Enabled: false
|
|
52
|
-
|
|
53
94
|
Metrics/MethodLength:
|
|
54
95
|
Max: 20
|
|
55
96
|
Enabled: false
|
|
56
|
-
|
|
57
97
|
Metrics/ModuleLength:
|
|
58
98
|
Max: 1000
|
|
59
99
|
Enabled: false
|
|
60
|
-
|
|
61
100
|
Metrics/PerceivedComplexity:
|
|
62
101
|
Max: 30
|
|
63
102
|
Enabled: false
|
|
64
|
-
|
|
103
|
+
Naming/BlockForwarding:
|
|
104
|
+
Enabled: true
|
|
105
|
+
Security/IoMethods:
|
|
106
|
+
Enabled: true
|
|
65
107
|
Security/MarshalLoad:
|
|
66
108
|
Enabled: false
|
|
67
|
-
|
|
68
109
|
Style/AndOr:
|
|
69
110
|
Enabled: false
|
|
70
|
-
|
|
111
|
+
Style/ArgumentsForwarding:
|
|
112
|
+
Enabled: true
|
|
71
113
|
Style/CaseEquality:
|
|
72
114
|
Enabled: false
|
|
73
|
-
|
|
115
|
+
Style/CollectionCompact:
|
|
116
|
+
Enabled: true
|
|
117
|
+
Style/DocumentDynamicEvalDefinition:
|
|
118
|
+
Enabled: true
|
|
74
119
|
Style/Documentation:
|
|
75
120
|
Enabled: false
|
|
76
|
-
|
|
77
121
|
Style/DoubleNegation:
|
|
78
122
|
Enabled: false
|
|
79
|
-
|
|
123
|
+
Style/EndlessMethod:
|
|
124
|
+
Enabled: true
|
|
80
125
|
Style/ExponentialNotation:
|
|
81
126
|
Enabled: true
|
|
82
|
-
|
|
127
|
+
Style/FileRead:
|
|
128
|
+
Enabled: true
|
|
129
|
+
Style/FileWrite:
|
|
130
|
+
Enabled: true
|
|
83
131
|
Style/FrozenStringLiteralComment:
|
|
84
132
|
Enabled: false
|
|
85
|
-
|
|
86
133
|
Style/GuardClause:
|
|
87
134
|
Enabled: false
|
|
88
|
-
|
|
135
|
+
Style/HashConversion:
|
|
136
|
+
Enabled: true
|
|
89
137
|
Style/HashEachMethods:
|
|
90
138
|
Enabled: true
|
|
91
|
-
|
|
139
|
+
Style/HashExcept:
|
|
140
|
+
Enabled: true
|
|
141
|
+
Style/HashSyntax:
|
|
142
|
+
Enabled: true
|
|
92
143
|
Style/HashTransformKeys:
|
|
93
144
|
Enabled: true
|
|
94
|
-
|
|
95
145
|
Style/HashTransformValues:
|
|
96
146
|
Enabled: true
|
|
97
|
-
|
|
98
147
|
Style/IfUnlessModifier:
|
|
99
148
|
Enabled: false
|
|
100
|
-
|
|
149
|
+
Style/IfWithBooleanLiteralBranches:
|
|
150
|
+
Enabled: true
|
|
151
|
+
Style/InPatternThen:
|
|
152
|
+
Enabled: true
|
|
153
|
+
Style/MapToHash:
|
|
154
|
+
Enabled: true
|
|
101
155
|
Style/MultilineBlockChain:
|
|
102
156
|
Enabled: false
|
|
103
|
-
|
|
104
157
|
Style/MultilineIfModifier:
|
|
105
158
|
Enabled: false
|
|
106
|
-
|
|
159
|
+
Style/MultilineInPatternThen:
|
|
160
|
+
Enabled: true
|
|
107
161
|
Style/MutableConstant:
|
|
108
162
|
Enabled: false
|
|
109
|
-
|
|
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
|
|
110
177
|
Style/RedundantRegexpCharacterClass:
|
|
111
178
|
Enabled: true
|
|
112
|
-
|
|
113
179
|
Style/RedundantRegexpEscape:
|
|
114
180
|
Enabled: true
|
|
115
|
-
|
|
181
|
+
Style/RedundantSelfAssignmentBranch:
|
|
182
|
+
Enabled: true
|
|
116
183
|
Style/RescueModifier:
|
|
117
184
|
Enabled: false
|
|
118
|
-
|
|
119
185
|
Style/RescueStandardError:
|
|
120
186
|
Enabled: false
|
|
121
|
-
|
|
187
|
+
Style/SelectByRegexp:
|
|
188
|
+
Enabled: true
|
|
122
189
|
Style/SlicingWithRange:
|
|
123
190
|
Enabled: true
|
|
124
|
-
|
|
191
|
+
Style/StringChars:
|
|
192
|
+
Enabled: true
|
|
193
|
+
Style/SwapValues:
|
|
194
|
+
Enabled: true
|
|
125
195
|
Style/TrailingCommaInArguments:
|
|
126
196
|
EnforcedStyleForMultiline: comma
|
|
127
|
-
|
|
128
197
|
Style/TrailingCommaInArrayLiteral:
|
|
129
198
|
EnforcedStyleForMultiline: consistent_comma
|
|
130
|
-
|
|
131
199
|
Style/TrailingCommaInHashLiteral:
|
|
132
200
|
EnforcedStyleForMultiline: consistent_comma
|
|
133
|
-
|
|
134
201
|
Style/ZeroLengthPredicate:
|
|
135
202
|
Enabled: false
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
3.0.3
|
data/.yardopts
ADDED
data/CODE_OF_CONDUCT.md
CHANGED
|
@@ -1,49 +1,133 @@
|
|
|
1
|
-
# Contributor Code of Conduct
|
|
2
1
|
|
|
3
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
|
20
|
-
|
|
21
|
-
* Other
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
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
|
|
35
|
-
|
|
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
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
|
46
|
-
[
|
|
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]:
|
|
49
|
-
[
|
|
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
|
[](https://badge.fury.io/rb/splitta)
|
|
11
|
-
[](https://github.com/david-mccullars/ruby-splitta/actions?workflow=CI)
|
|
12
12
|
[](https://codeclimate.com/github/david-mccullars/ruby-splitta)
|
|
13
13
|
[](https://codeclimate.com/github/david-mccullars/ruby-splitta/coverage)
|
|
14
|
+
[](LICENSE)
|
|
14
15
|
|
|
15
16
|
## Description
|
|
16
17
|
|
data/Rakefile
CHANGED
|
@@ -1,36 +1,17 @@
|
|
|
1
|
-
require
|
|
2
|
-
require
|
|
1
|
+
require 'bundler/gem_tasks'
|
|
2
|
+
require 'rspec/core/rake_task'
|
|
3
|
+
require 'yard'
|
|
3
4
|
|
|
4
5
|
RSpec::Core::RakeTask.new(:spec)
|
|
5
6
|
|
|
6
|
-
task :
|
|
7
|
+
task default: :spec
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
RDoc::Task.new do |rdoc|
|
|
10
|
-
rdoc.main = "README.md"
|
|
11
|
-
rdoc.rdoc_files.include("README.md", "lib/**/*.rb")
|
|
12
|
-
end
|
|
9
|
+
YARD::Rake::YardocTask.new
|
|
13
10
|
|
|
14
11
|
def unpickle(file)
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
cPickle = import 'cPickle'
|
|
19
|
-
gzip = import 'gzip'
|
|
20
|
-
|
|
21
|
-
io = gzip.open(file, 'rb')
|
|
22
|
-
data = cPickle.load(io)
|
|
23
|
-
io.close()
|
|
24
|
-
|
|
25
|
-
data = data.rubify
|
|
26
|
-
if data.keys.first.is_a?(RubyPython::Tuple)
|
|
27
|
-
data = data.each_with_object({}) do |(k, v), h|
|
|
28
|
-
h[k.to_a] = v
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
return data
|
|
33
|
-
end
|
|
12
|
+
out, status = Open3.capture2e("bin/pickle2json #{file.inspect}")
|
|
13
|
+
abort out unless status.success?
|
|
14
|
+
JSON.parse(out).to_h
|
|
34
15
|
end
|
|
35
16
|
|
|
36
17
|
def gzip_dump(file, obj)
|
|
@@ -44,12 +25,19 @@ def gzip_dump(file, obj)
|
|
|
44
25
|
end
|
|
45
26
|
|
|
46
27
|
task :unpickle, [:file] do |_t, args|
|
|
28
|
+
require 'json'
|
|
29
|
+
require 'open3'
|
|
30
|
+
|
|
47
31
|
files = Dir[args[:file] || 'data/src/**/*'].select do |f|
|
|
48
32
|
File.file?(f)
|
|
49
33
|
end
|
|
50
34
|
|
|
51
|
-
files.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
35
|
+
files.map do |src|
|
|
36
|
+
fork do
|
|
37
|
+
puts "Unpickling #{src} ..."
|
|
38
|
+
gzip_dump(src.sub('/src/', '/'), unpickle(src))
|
|
39
|
+
end
|
|
40
|
+
end.map do |pid|
|
|
41
|
+
Process.wait2(pid).last
|
|
42
|
+
end.all?(&:success?) or exit(1)
|
|
55
43
|
end
|
data/bin/pickle2json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
import gzip
|
|
3
|
+
import json
|
|
4
|
+
import pickle
|
|
5
|
+
import sys
|
|
6
|
+
|
|
7
|
+
if len(sys.argv) < 2:
|
|
8
|
+
sys.exit('Usage: pickle2json <GZIP PICKLE FILE>')
|
|
9
|
+
|
|
10
|
+
with gzip.open(sys.argv[1], 'rb') as f:
|
|
11
|
+
data = pickle.load(f)
|
|
12
|
+
if type(data) is dict and type(next(iter(data))) is tuple:
|
|
13
|
+
data = [[[k[0], k[1]], v] for k, v in data.items()]
|
|
14
|
+
print(json.dumps(data))
|
data/data/feats
CHANGED
|
Binary file
|
data/data/lower_words
CHANGED
|
Binary file
|
data/data/non_abbrs
CHANGED
|
Binary file
|
data/lib/splitta/version.rb
CHANGED
data/splitta.gemspec
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
lib = File.expand_path('
|
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
require 'splitta/version'
|
|
4
4
|
|
|
@@ -18,10 +18,19 @@ Gem::Specification.new do |spec|
|
|
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
19
19
|
spec.require_paths = ['lib']
|
|
20
20
|
|
|
21
|
+
spec.required_ruby_version = '>= 3.0.0'
|
|
22
|
+
|
|
21
23
|
spec.add_development_dependency 'bundler'
|
|
24
|
+
spec.add_development_dependency 'github-markup'
|
|
22
25
|
spec.add_development_dependency 'rake'
|
|
26
|
+
spec.add_development_dependency 'redcarpet'
|
|
23
27
|
spec.add_development_dependency 'rspec'
|
|
24
28
|
spec.add_development_dependency 'rubocop'
|
|
25
|
-
spec.add_development_dependency '
|
|
29
|
+
spec.add_development_dependency 'rubocop-rake'
|
|
30
|
+
spec.add_development_dependency 'rubocop-rspec'
|
|
26
31
|
spec.add_development_dependency 'simplecov', '~> 0.17.0' # 0.18 not supported by code climate
|
|
32
|
+
spec.add_development_dependency 'yard'
|
|
33
|
+
spec.metadata = {
|
|
34
|
+
'rubygems_mfa_required' => 'true',
|
|
35
|
+
}
|
|
27
36
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: splitta
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 5.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David McCullars
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-01-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -24,6 +24,20 @@ dependencies:
|
|
|
24
24
|
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '0'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: github-markup
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
27
41
|
- !ruby/object:Gem::Dependency
|
|
28
42
|
name: rake
|
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -38,6 +52,20 @@ dependencies:
|
|
|
38
52
|
- - ">="
|
|
39
53
|
- !ruby/object:Gem::Version
|
|
40
54
|
version: '0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: redcarpet
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - ">="
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '0'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - ">="
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '0'
|
|
41
69
|
- !ruby/object:Gem::Dependency
|
|
42
70
|
name: rspec
|
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -67,7 +95,21 @@ dependencies:
|
|
|
67
95
|
- !ruby/object:Gem::Version
|
|
68
96
|
version: '0'
|
|
69
97
|
- !ruby/object:Gem::Dependency
|
|
70
|
-
name:
|
|
98
|
+
name: rubocop-rake
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - ">="
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: '0'
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - ">="
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '0'
|
|
111
|
+
- !ruby/object:Gem::Dependency
|
|
112
|
+
name: rubocop-rspec
|
|
71
113
|
requirement: !ruby/object:Gem::Requirement
|
|
72
114
|
requirements:
|
|
73
115
|
- - ">="
|
|
@@ -94,6 +136,20 @@ dependencies:
|
|
|
94
136
|
- - "~>"
|
|
95
137
|
- !ruby/object:Gem::Version
|
|
96
138
|
version: 0.17.0
|
|
139
|
+
- !ruby/object:Gem::Dependency
|
|
140
|
+
name: yard
|
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
|
142
|
+
requirements:
|
|
143
|
+
- - ">="
|
|
144
|
+
- !ruby/object:Gem::Version
|
|
145
|
+
version: '0'
|
|
146
|
+
type: :development
|
|
147
|
+
prerelease: false
|
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
149
|
+
requirements:
|
|
150
|
+
- - ">="
|
|
151
|
+
- !ruby/object:Gem::Version
|
|
152
|
+
version: '0'
|
|
97
153
|
description: Implementation of Splitta in Ruby. See https://code.google.com/archive/p/splitta/
|
|
98
154
|
email:
|
|
99
155
|
- david.mccullars@gmail.com
|
|
@@ -102,15 +158,18 @@ extensions: []
|
|
|
102
158
|
extra_rdoc_files: []
|
|
103
159
|
files:
|
|
104
160
|
- ".codeclimate.yml"
|
|
161
|
+
- ".github/workflows/ci.yml"
|
|
105
162
|
- ".gitignore"
|
|
163
|
+
- ".rspec"
|
|
106
164
|
- ".rubocop.yml"
|
|
107
165
|
- ".ruby-version"
|
|
108
|
-
- ".
|
|
166
|
+
- ".yardopts"
|
|
109
167
|
- CODE_OF_CONDUCT.md
|
|
110
168
|
- Gemfile
|
|
111
169
|
- LICENSE
|
|
112
170
|
- README.md
|
|
113
171
|
- Rakefile
|
|
172
|
+
- bin/pickle2json
|
|
114
173
|
- data/feats
|
|
115
174
|
- data/lower_words
|
|
116
175
|
- data/non_abbrs
|
|
@@ -127,8 +186,9 @@ files:
|
|
|
127
186
|
homepage: https://github.com/david-mccullars/ruby-splitta
|
|
128
187
|
licenses:
|
|
129
188
|
- MIT
|
|
130
|
-
metadata:
|
|
131
|
-
|
|
189
|
+
metadata:
|
|
190
|
+
rubygems_mfa_required: 'true'
|
|
191
|
+
post_install_message:
|
|
132
192
|
rdoc_options: []
|
|
133
193
|
require_paths:
|
|
134
194
|
- lib
|
|
@@ -136,16 +196,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
136
196
|
requirements:
|
|
137
197
|
- - ">="
|
|
138
198
|
- !ruby/object:Gem::Version
|
|
139
|
-
version:
|
|
199
|
+
version: 3.0.0
|
|
140
200
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
201
|
requirements:
|
|
142
202
|
- - ">="
|
|
143
203
|
- !ruby/object:Gem::Version
|
|
144
204
|
version: '0'
|
|
145
205
|
requirements: []
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
signing_key:
|
|
206
|
+
rubygems_version: 3.2.32
|
|
207
|
+
signing_key:
|
|
149
208
|
specification_version: 4
|
|
150
209
|
summary: Implementation of Splitta in Ruby
|
|
151
210
|
test_files: []
|
data/.travis.yml
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
env:
|
|
2
|
-
global:
|
|
3
|
-
- CC_TEST_REPORTER_ID=35dd438da367278dc0d80cb7e21b3b0cd6eb207f60890a05c3fe1f0882981e64
|
|
4
|
-
language: ruby
|
|
5
|
-
rvm:
|
|
6
|
-
- 2.5.1
|
|
7
|
-
before_install: gem install bundler -v 1.17.3
|
|
8
|
-
before_script:
|
|
9
|
-
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
|
10
|
-
- chmod +x ./cc-test-reporter
|
|
11
|
-
- ./cc-test-reporter before-build
|
|
12
|
-
script:
|
|
13
|
-
- bundle exec rspec
|
|
14
|
-
after_script:
|
|
15
|
-
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|