srx-languagetool 0.1.0 → 0.5.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/.github/workflows/main.yml +2 -2
- data/.gitignore +1 -0
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +5 -4
- data/.ruby-version +1 -0
- data/CHANGELOG.md +17 -0
- data/Gemfile.lock +29 -25
- data/README.md +14 -2
- data/lib/srx/languagetool/version.rb +1 -1
- data/lib/srx/segment.srx +310 -215
- data/srx-languagetool.gemspec +2 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95785521482bc1320317e3de14176b86f63c2df5a670ee1f52ce820f0e73fc12
|
4
|
+
data.tar.gz: 20ac98ad63e4618da846b2b21d907ee965c12e8ae16d5d42f713cd50906dcf4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 135e9dea7489c2d50c50df10df5ad49672b212ef3269a559a8309e67281dfa01cb2ba93372a33b11798a4ccb8cbacbac29429c135cc412d361fd0fc8566d7e4d
|
7
|
+
data.tar.gz: 845ff08b14a5f7f0a0fdff7d2ba570113870eaed2eaa2b6c78b772431ddf38d4af735c6d0c2a2490f7d827712c789144816885e2de88a1075f02f7776066977b
|
data/.github/workflows/main.yml
CHANGED
@@ -10,10 +10,10 @@ jobs:
|
|
10
10
|
- name: Set up Ruby
|
11
11
|
uses: ruby/setup-ruby@v1
|
12
12
|
with:
|
13
|
-
ruby-version: 2.7.
|
13
|
+
ruby-version: 2.7.5
|
14
14
|
- name: Install
|
15
15
|
run: |
|
16
|
-
gem install bundler -v 2.
|
16
|
+
gem install bundler -v 2.3.4
|
17
17
|
bundle install
|
18
18
|
- name: Type check
|
19
19
|
run: bundle exec solargraph typecheck --level typed
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2021-
|
3
|
+
# on 2021-10-03 07:48:00 UTC using RuboCop version 1.22.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
@@ -9,7 +9,7 @@
|
|
9
9
|
# Offense count: 2
|
10
10
|
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
|
11
11
|
Metrics/AbcSize:
|
12
|
-
Max:
|
12
|
+
Max: 69
|
13
13
|
|
14
14
|
# Offense count: 5
|
15
15
|
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
@@ -20,14 +20,15 @@ Metrics/BlockLength:
|
|
20
20
|
# Offense count: 1
|
21
21
|
# Configuration parameters: CountComments, CountAsOne.
|
22
22
|
Metrics/ClassLength:
|
23
|
-
Max:
|
23
|
+
Max: 136
|
24
24
|
|
25
25
|
# Offense count: 3
|
26
26
|
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
27
27
|
Metrics/MethodLength:
|
28
|
-
Max:
|
28
|
+
Max: 71
|
29
29
|
|
30
30
|
# Offense count: 1
|
31
|
+
# Configuration parameters: AllowedConstants.
|
31
32
|
Style/Documentation:
|
32
33
|
Exclude:
|
33
34
|
- 'spec/**/*'
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.7.5
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.5.0] - 2021-12-31
|
4
|
+
|
5
|
+
- Update rules to LanguageTool 5.6
|
6
|
+
|
7
|
+
## [0.4.0] - 2021-10-03
|
8
|
+
|
9
|
+
- Update rules to LanguageTool 5.5
|
10
|
+
- Document `_one` and `_two` language suffixes (see README)
|
11
|
+
|
12
|
+
## [0.3.0] - 2021-06-26
|
13
|
+
|
14
|
+
- Update rules to LanguageTool 5.4
|
15
|
+
|
16
|
+
## [0.2.0] - 2021-04-15
|
17
|
+
|
18
|
+
- Update rules to LanguageTool 5.3
|
19
|
+
|
3
20
|
## [0.1.0] - 2021-02-13
|
4
21
|
|
5
22
|
- Initial release
|
data/Gemfile.lock
CHANGED
@@ -1,56 +1,57 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
srx-languagetool (0.
|
4
|
+
srx-languagetool (0.5.0)
|
5
5
|
srx (< 1.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
10
|
ast (2.4.2)
|
11
|
-
backport (1.
|
12
|
-
benchmark (0.
|
11
|
+
backport (1.2.0)
|
12
|
+
benchmark (0.2.0)
|
13
13
|
byebug (11.1.3)
|
14
|
-
diff-lcs (1.
|
14
|
+
diff-lcs (1.5.0)
|
15
15
|
e2mmap (0.1.0)
|
16
16
|
jaro_winkler (1.5.4)
|
17
|
-
kramdown (2.3.
|
17
|
+
kramdown (2.3.1)
|
18
18
|
rexml
|
19
19
|
kramdown-parser-gfm (1.1.0)
|
20
20
|
kramdown (~> 2.0)
|
21
|
-
minitest (5.
|
22
|
-
nokogiri (1.
|
21
|
+
minitest (5.15.0)
|
22
|
+
nokogiri (1.12.5-x86_64-darwin)
|
23
23
|
racc (~> 1.4)
|
24
|
-
parallel (1.
|
25
|
-
parser (3.0.
|
24
|
+
parallel (1.21.0)
|
25
|
+
parser (3.0.3.2)
|
26
26
|
ast (~> 2.4.1)
|
27
|
-
racc (1.
|
27
|
+
racc (1.6.0)
|
28
28
|
rainbow (3.0.0)
|
29
|
-
rake (13.0.
|
30
|
-
regexp_parser (2.0
|
31
|
-
reverse_markdown (2.
|
29
|
+
rake (13.0.6)
|
30
|
+
regexp_parser (2.2.0)
|
31
|
+
reverse_markdown (2.1.1)
|
32
32
|
nokogiri
|
33
|
-
rexml (3.2.
|
33
|
+
rexml (3.2.5)
|
34
34
|
rspec-expectations (3.10.1)
|
35
35
|
diff-lcs (>= 1.2.0, < 2.0)
|
36
36
|
rspec-support (~> 3.10.0)
|
37
|
-
rspec-support (3.10.
|
38
|
-
rubocop (1.
|
37
|
+
rspec-support (3.10.3)
|
38
|
+
rubocop (1.24.0)
|
39
39
|
parallel (~> 1.10)
|
40
40
|
parser (>= 3.0.0.0)
|
41
41
|
rainbow (>= 2.2.2, < 4.0)
|
42
42
|
regexp_parser (>= 1.8, < 3.0)
|
43
43
|
rexml
|
44
|
-
rubocop-ast (>= 1.
|
44
|
+
rubocop-ast (>= 1.15.0, < 2.0)
|
45
45
|
ruby-progressbar (~> 1.7)
|
46
46
|
unicode-display_width (>= 1.4.0, < 3.0)
|
47
|
-
rubocop-ast (1.
|
48
|
-
parser (>=
|
47
|
+
rubocop-ast (1.15.1)
|
48
|
+
parser (>= 3.0.1.1)
|
49
49
|
ruby-progressbar (1.11.0)
|
50
|
-
solargraph (0.
|
51
|
-
backport (~> 1.
|
50
|
+
solargraph (0.44.2)
|
51
|
+
backport (~> 1.2)
|
52
52
|
benchmark
|
53
53
|
bundler (>= 1.17.2)
|
54
|
+
diff-lcs (~> 1.4)
|
54
55
|
e2mmap
|
55
56
|
jaro_winkler (~> 1.5)
|
56
57
|
kramdown (~> 2.3)
|
@@ -61,15 +62,18 @@ GEM
|
|
61
62
|
thor (~> 1.0)
|
62
63
|
tilt (~> 2.0)
|
63
64
|
yard (~> 0.9, >= 0.9.24)
|
64
|
-
srx (0.
|
65
|
+
srx (0.6.0)
|
65
66
|
nokogiri (~> 1.11)
|
66
67
|
thor (1.1.0)
|
67
68
|
tilt (2.0.10)
|
68
|
-
unicode-display_width (2.
|
69
|
-
|
69
|
+
unicode-display_width (2.1.0)
|
70
|
+
webrick (1.7.0)
|
71
|
+
yard (0.9.27)
|
72
|
+
webrick (~> 1.7.0)
|
70
73
|
|
71
74
|
PLATFORMS
|
72
75
|
x86_64-darwin-20
|
76
|
+
x86_64-darwin-21
|
73
77
|
|
74
78
|
DEPENDENCIES
|
75
79
|
byebug
|
@@ -81,4 +85,4 @@ DEPENDENCIES
|
|
81
85
|
srx-languagetool!
|
82
86
|
|
83
87
|
BUNDLED WITH
|
84
|
-
2.
|
88
|
+
2.3.4
|
data/README.md
CHANGED
@@ -25,17 +25,29 @@ Or install it yourself as:
|
|
25
25
|
|
26
26
|
## Usage
|
27
27
|
|
28
|
-
For detailed usage information, please see
|
28
|
+
For detailed usage information about the engine, please see
|
29
29
|
[srx-ruby](https://github.com/amake/srx-ruby).
|
30
30
|
|
31
31
|
```ruby
|
32
|
-
require 'srx
|
32
|
+
require 'srx/languagetool'
|
33
33
|
|
34
34
|
data = Srx::Data.languagetool
|
35
35
|
engine = Srx::Engine.new(data)
|
36
36
|
engine.segment('Hi. How are you?', language: 'en') #=> ["Hi.", " How are you?"]
|
37
37
|
```
|
38
38
|
|
39
|
+
**Note:** To split on single line breaks, append the suffix `_one` to the
|
40
|
+
language. To split only on two or more consecutive line breaks, append `_two`.
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
engine.segment("Hi. \n\n\nHow are you?", language: 'en')
|
44
|
+
#=> ["Hi. \n\n\nHow are you?"]
|
45
|
+
engine.segment('Hi. \n\n\nHow are you?', language: 'en_one')
|
46
|
+
#=> ["Hi. \n", "\n", "\n", "How are you?"]
|
47
|
+
engine.segment('Hi. \n\n\nHow are you?', language: 'en_two')
|
48
|
+
#=> ["Hi. \n\n\n", "How are you?"]
|
49
|
+
```
|
50
|
+
|
39
51
|
## Development
|
40
52
|
|
41
53
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|