simple_english 0.6.0-aarch64-linux
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 +7 -0
- data/LICENSE +21 -0
- data/README.md +212 -0
- data/THIRD_PARTY_NOTICES.md +72 -0
- data/bin/se +6 -0
- data/docs/RULES.md +496 -0
- data/lib/simple_english/cli.rb +183 -0
- data/lib/simple_english/client/daemon.rb +233 -0
- data/lib/simple_english/client/language_tool.rb +95 -0
- data/lib/simple_english/daemon/engine.rb +40 -0
- data/lib/simple_english/daemon/http.rb +82 -0
- data/lib/simple_english/daemon/server.rb +285 -0
- data/lib/simple_english/lint/annotated_text.rb +117 -0
- data/lib/simple_english/lint/counts.rb +40 -0
- data/lib/simple_english/lint/extractor.rb +60 -0
- data/lib/simple_english/lint/finding.rb +24 -0
- data/lib/simple_english/lint/lint_plan.rb +22 -0
- data/lib/simple_english/lint/markdown.rb +121 -0
- data/lib/simple_english/lint/paragraph.rb +10 -0
- data/lib/simple_english/lint/plain_text.rb +30 -0
- data/lib/simple_english/lint/result.rb +18 -0
- data/lib/simple_english/lint/segment.rb +11 -0
- data/lib/simple_english/lint/span.rb +8 -0
- data/lib/simple_english/lint/suppressions.rb +37 -0
- data/lib/simple_english/model_context_protocol.rb +134 -0
- data/lib/simple_english/setup/config.rb +63 -0
- data/lib/simple_english/setup/fingerprint.rb +38 -0
- data/lib/simple_english/setup/install.rb +40 -0
- data/lib/simple_english/setup/languagetool.rb +23 -0
- data/lib/simple_english/version.rb +5 -0
- data/lib/simple_english.rb +60 -0
- data/libexec/simple_english/languagetool-server +4 -0
- data/libexec/simple_english/languagetool-server.sbom.json +9044 -0
- data/licenses/LGPL-2.1.txt +501 -0
- data/licenses/OpenJDK-LICENSE.txt +347 -0
- data/licenses/languagetool-resource-en/12dicts-readme.html +738 -0
- data/licenses/languagetool-resource-en/agid-readme.txt +340 -0
- data/licenses/languagetool-resource-en/pos-readme.txt +115 -0
- data/rules/simple-english.xml +621 -0
- metadata +185 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 5122afb44d3c0332b53c7636a893150d5d27bf2a80d49cae239d44e57c250ea2
|
|
4
|
+
data.tar.gz: c4e8fcf8f0c5a0dd9ebd31ab5f4e8c1f93d7bd37118015da48d0c21ba2d82656
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 694c1b6d1af013b704a8ece195f9e55f0189b1220b01fd259aa04fc255ff4f82df3c264dc75d3bdde65e2a53c67529876f25d370d8397e6d1febec36f8cf4b8c
|
|
7
|
+
data.tar.gz: d72828c6a2d99e17a5d0a7f3d5e0fb5e20a06a47ac7baa7375de393986753c9bd7471cada8bc8a748d818bc21e35f6e4cf4f8ed47b8460896bd4d469baab489b
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 tony.hsu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
[](https://github.com/TonyCTHsu/simple-english/actions/workflows/ci.yml) <!-- se: ignore=SE_PARAGRAPH_TOO_LONG -->
|
|
2
|
+
[](https://badge.fury.io/rb/simple_english)
|
|
3
|
+
[](https://github.com/TonyCTHsu/simple-english/blob/master/LICENSE)
|
|
4
|
+
|
|
5
|
+
# simple_english
|
|
6
|
+
|
|
7
|
+
> Write for human, not for agent.
|
|
8
|
+
|
|
9
|
+
You can teach an agent plain-English prose with a skill or a
|
|
10
|
+
prompt. It writes clean prose in the first paragraph and slop again
|
|
11
|
+
by the third. This linter keeps the agent honest: it reads what the
|
|
12
|
+
agent wrote and names every broken rule. Send the findings back, and
|
|
13
|
+
the agent corrects its own text.
|
|
14
|
+
|
|
15
|
+
<table>
|
|
16
|
+
<tr>
|
|
17
|
+
<th width="50%">Before</th>
|
|
18
|
+
<th width="50%">After</th>
|
|
19
|
+
</tr>
|
|
20
|
+
<tr>
|
|
21
|
+
<td valign="top">
|
|
22
|
+
|
|
23
|
+
> Your API keys are rotated by the service every 90 days — you will need to update them if you get a 401; don't panic, simply re-run the setup command, which regenerates the credentials without any downtime. <!-- se: ignore -->
|
|
24
|
+
|
|
25
|
+
</td>
|
|
26
|
+
<td valign="top">
|
|
27
|
+
|
|
28
|
+
> The service rotates your API keys every 90 days. If you get a 401, update them. Do not panic. Re-run the setup command. It regenerates the credentials without any downtime.
|
|
29
|
+
|
|
30
|
+
</td>
|
|
31
|
+
</tr>
|
|
32
|
+
</table>
|
|
33
|
+
|
|
34
|
+
The linter covers Markdown prose plus code comments in Python, Ruby,
|
|
35
|
+
JavaScript, TypeScript, Go, Rust, Java, C#, C++, Kotlin, bash, and
|
|
36
|
+
YAML. Findings print as plain text, JSON, or SARIF.
|
|
37
|
+
|
|
38
|
+
If your language is not on the list, [open an issue](https://github.com/TonyCTHsu/simple-english/issues).
|
|
39
|
+
|
|
40
|
+
## Agent integrations
|
|
41
|
+
|
|
42
|
+
Plug the linter into your coding agent. It checks its own draft
|
|
43
|
+
before you read the file.
|
|
44
|
+
|
|
45
|
+
| Coding agent | Integration |
|
|
46
|
+
|---|---|
|
|
47
|
+
| pi | [pi-simple-english](integrations/pi/README.md) |
|
|
48
|
+
| Claude Code | [simple-english](integrations/claude-code/README.md) |
|
|
49
|
+
| Codex | [simple-english](integrations/codex/README.md) |
|
|
50
|
+
|
|
51
|
+
If your agent is not on the list, [open an issue](https://github.com/TonyCTHsu/simple-english/issues).
|
|
52
|
+
|
|
53
|
+
## The rules
|
|
54
|
+
|
|
55
|
+
- **Voice:** say who does the action.
|
|
56
|
+
- **Tense:** simple tenses only, no present perfect.
|
|
57
|
+
- **Modals:** `can`, `will`, `must` only.
|
|
58
|
+
- **Punctuation:** no em-dashes, no semicolons.
|
|
59
|
+
- **Contractions:** write every word in full.
|
|
60
|
+
- **Sentence shape:** condition before command, no `-ing` phrase after a comma.
|
|
61
|
+
- **Word choice:** about 50 substitution rules, from `leverage` to `in conclusion`. `make sure that` keeps its "that".
|
|
62
|
+
- **Code comments:** same pattern rules, with line and column range.
|
|
63
|
+
- **Counts (Markdown only):** 20 words per sentence in list items, 25 in paragraphs, six sentences per paragraph at most.
|
|
64
|
+
|
|
65
|
+
The full list, with a wrong and a right example for each rule [docs/RULES.md](docs/RULES.md).
|
|
66
|
+
|
|
67
|
+
## Install
|
|
68
|
+
|
|
69
|
+
### Homebrew (macOS arm64)
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
brew install TonyCTHsu/tap/simple-english
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Ruby gem (macOS arm64, Linux x86-64 and arm64)
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
gem install simple_english
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Container
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
docker run --rm -v "$PWD":/work ghcr.io/tonycthsu/simple-english .
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Usage
|
|
88
|
+
|
|
89
|
+
Lint files, directories, or stdin:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
se README.md
|
|
93
|
+
se docs/ # every .md, .py, .rb, .yaml, .yml, ... under docs/
|
|
94
|
+
se - < notes.md # stdin (Markdown)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Lint only what changed:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
git diff --name-only --diff-filter=ACM main | xargs -I{} se {}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Outputs
|
|
104
|
+
|
|
105
|
+
Pattern findings print an exclusive column range as
|
|
106
|
+
`file:line:start-end: [RULE_ID] message`. A range that crosses lines ends
|
|
107
|
+
with `end-line:end-column`. Columns count UTF-16 code units. Counting findings
|
|
108
|
+
identify only the paragraph's first line. JSON and SARIF output expose the same
|
|
109
|
+
source ranges:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
se --format json docs/
|
|
113
|
+
se --format sarif src/ > results.sarif
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Exit codes
|
|
117
|
+
|
|
118
|
+
- `0`: no findings
|
|
119
|
+
- `1`: findings
|
|
120
|
+
- `2`: input, configuration, installation, or daemon error
|
|
121
|
+
|
|
122
|
+
### MCP server
|
|
123
|
+
|
|
124
|
+
Start an MCP stdio server with one tool, `lint`. Any MCP
|
|
125
|
+
client can call it.
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
se mcp
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### CI
|
|
132
|
+
|
|
133
|
+
Gate the prose in the pull request that changes it. The plain run
|
|
134
|
+
fails the build on findings, and the SARIF report puts them inline:
|
|
135
|
+
|
|
136
|
+
```yaml
|
|
137
|
+
name: lint-docs
|
|
138
|
+
on: [pull_request]
|
|
139
|
+
permissions:
|
|
140
|
+
security-events: write
|
|
141
|
+
jobs:
|
|
142
|
+
lint:
|
|
143
|
+
runs-on: ubuntu-latest
|
|
144
|
+
steps:
|
|
145
|
+
- uses: actions/checkout@v7
|
|
146
|
+
- uses: ruby/setup-ruby@v1
|
|
147
|
+
- run: gem install simple_english
|
|
148
|
+
- run: se --format sarif . > lint.sarif
|
|
149
|
+
- run: se .
|
|
150
|
+
- uses: github/codeql-action/upload-sarif@v3
|
|
151
|
+
with:
|
|
152
|
+
sarif_file: lint.sarif
|
|
153
|
+
if: always()
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Config and suppressions
|
|
157
|
+
|
|
158
|
+
### Config file
|
|
159
|
+
|
|
160
|
+
`.simple-english.yml` in the working directory:
|
|
161
|
+
|
|
162
|
+
```yaml
|
|
163
|
+
ignore:
|
|
164
|
+
- vendor/**
|
|
165
|
+
disabled-rules:
|
|
166
|
+
- SE_NO_EMDASH
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
`ignore` globs: `**` crosses directories, `*` stays in one segment.
|
|
170
|
+
|
|
171
|
+
### Inline suppressions
|
|
172
|
+
|
|
173
|
+
A line containing `se: ignore` suppresses findings reported on that
|
|
174
|
+
line. Use `se: ignore=RULE1,RULE2` to scope it to rules. Pattern
|
|
175
|
+
findings cite the line of the match, so put the directive on the line the
|
|
176
|
+
finding reports.
|
|
177
|
+
|
|
178
|
+
In Markdown:
|
|
179
|
+
|
|
180
|
+
```markdown
|
|
181
|
+
The daemon keeps it's own lock. <!-- se: ignore=SE_NO_CONTRACTIONS -->
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
In a code comment:
|
|
185
|
+
|
|
186
|
+
```ruby
|
|
187
|
+
# Don't touch this constant. se: ignore=SE_NO_CONTRACTIONS
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## FAQ
|
|
191
|
+
|
|
192
|
+
### Have you thought about an agent skill?
|
|
193
|
+
|
|
194
|
+
This project takes its idea from [SimpleEnglish](https://github.com/AminBlg/SimpleEnglish). If you like, use both: the skill helps the first draft, and the linter catches what the agent missed.
|
|
195
|
+
|
|
196
|
+
### Why not Vale?
|
|
197
|
+
|
|
198
|
+
We ported rules to Vale and ran the corpus on both engines.
|
|
199
|
+
About 60 rules behave the same. Vale has no check for the em-dash
|
|
200
|
+
and semicolon rules: its checks see words, not punctuation. Its
|
|
201
|
+
tagger also mislabels verbs, so the condition-first rule stays
|
|
202
|
+
silent. Closing the Vale gaps needs scripts or an external
|
|
203
|
+
tagger, and that erases Vale's main advantage: one binary with no
|
|
204
|
+
service behind it.
|
|
205
|
+
|
|
206
|
+
## Scope
|
|
207
|
+
|
|
208
|
+
This tool does not check ASD-STE100 compliance. This repo holds no ASD-STE100 text. If you need full compliance, read the free standard at <https://www.asd-ste100.org/>.
|
|
209
|
+
|
|
210
|
+
## Develop
|
|
211
|
+
|
|
212
|
+
To change the linter, add rules, or run the tests, read [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md).
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
Files under `licenses/` carry the license texts and upstream notices
|
|
4
|
+
for third-party software distributed inside this gem. Simple English's
|
|
5
|
+
own code is MIT-licensed; see `LICENSE`.
|
|
6
|
+
|
|
7
|
+
## Lint engine
|
|
8
|
+
|
|
9
|
+
Each platform gem ships a compiled lint engine at
|
|
10
|
+
`libexec/simple_english/languagetool-server`. The binary is built with
|
|
11
|
+
GraalVM Community Edition 25.0.2 and contains code from the
|
|
12
|
+
components below. The authoritative list of components inside a given
|
|
13
|
+
binary is the CycloneDX SBOM published with each release
|
|
14
|
+
(`dist/languagetool-server-<platform>.sbom.json`).
|
|
15
|
+
|
|
16
|
+
| Component | License | Notice |
|
|
17
|
+
|---|---|---|
|
|
18
|
+
| LanguageTool 6.6 (`languagetool-core`, `languagetool-server`, `languagetool-gui-commons`, `language-en`, `language-ca`, `language-es`, `language-pt`), unmodified except for a build-time copy of `rules/simple-english.xml` into the English rules | LGPL-2.1 | `licenses/LGPL-2.1.txt` |
|
|
19
|
+
| English word-list and POS data (12dicts, AGID, Moby/WordNet POS) | upstream terms, public domain | `licenses/languagetool-resource-en/` |
|
|
20
|
+
| `at.favre.lib:bcrypt` 0.10.2 | Apache-2.0 | |
|
|
21
|
+
| `ch.qos.logback:logback-classic` 1.5.18 | EPL-1.0 or LGPL-2.1 | |
|
|
22
|
+
| `co.elastic.logging:logback-ecs-encoder` 1.3.2 | Apache-2.0 | |
|
|
23
|
+
| `com.fasterxml.jackson.core:jackson-databind` 2.18.0 | Apache-2.0 | |
|
|
24
|
+
| `commons-cli:commons-cli` 1.9.0 | Apache-2.0 | |
|
|
25
|
+
| `commons-codec:commons-codec` 1.17.1 | Apache-2.0 | |
|
|
26
|
+
| `edu.washington.cs.knowitall:opennlp-*` models 1.5 | Apache-2.0 | |
|
|
27
|
+
| `io.lettuce:lettuce-core` 6.5.4 | MIT | |
|
|
28
|
+
| `io.prometheus:simpleclient_*` 0.16.0 | Apache-2.0 | |
|
|
29
|
+
| `org.apache.opennlp:opennlp-tools` 1.9.4 | Apache-2.0 | |
|
|
30
|
+
| `org.mariadb.jdbc:mariadb-java-client` 3.4.1 | LGPL-2.1 | `licenses/LGPL-2.1.txt` |
|
|
31
|
+
| `org.mybatis:mybatis` 3.5.16 | Apache-2.0 | |
|
|
32
|
+
| `org.slf4j:slf4j-api` 2.0.16 | MIT | |
|
|
33
|
+
| GraalVM and OpenJDK runtime code | GPLv2 with the Classpath Exception | `licenses/OpenJDK-LICENSE.txt` |
|
|
34
|
+
|
|
35
|
+
The engine uses logback under its LGPL-2.1 option, not its EPL-1.0
|
|
36
|
+
option.
|
|
37
|
+
|
|
38
|
+
## LGPL 2.1 obligations
|
|
39
|
+
|
|
40
|
+
LanguageTool is licensed under the GNU Lesser General Public License
|
|
41
|
+
2.1. This gem distributes a binary statically linked with
|
|
42
|
+
LanguageTool, which LGPL 2.1 section 6 permits when recipients can
|
|
43
|
+
study, modify, and rebuild the LGPL part:
|
|
44
|
+
|
|
45
|
+
- The license text ships with every gem (`licenses/LGPL-2.1.txt`).
|
|
46
|
+
- The corresponding LanguageTool source is the `v6.6` tag at
|
|
47
|
+
https://github.com/languagetool-org/languagetool/tree/v6.6
|
|
48
|
+
- The gem's MIT license permits reverse engineering, so you may
|
|
49
|
+
debug the binary and your modifications to it.
|
|
50
|
+
- You can rebuild the engine against a modified LanguageTool: change
|
|
51
|
+
the version in `native/languagetool/pom.xml` and follow the
|
|
52
|
+
rebuild steps in `native/languagetool/README.md` under "Changing
|
|
53
|
+
the native engine".
|
|
54
|
+
|
|
55
|
+
Written offer under section 6(c): we give any recipient the
|
|
56
|
+
machine-readable materials that section 6(a) names, for at least three
|
|
57
|
+
years after each release, at no charge. Ask in an issue at
|
|
58
|
+
https://github.com/TonyCTHsu/simple-english/issues. The materials are
|
|
59
|
+
the LanguageTool `v6.6` source, the resolved classpath of
|
|
60
|
+
`native/languagetool/pom.xml` as Maven Central artifacts, the
|
|
61
|
+
reachability metadata under `native/languagetool/config/`, and the
|
|
62
|
+
build scripts `native/languagetool/build.rb` and `Rakefile` with the
|
|
63
|
+
`rules/simple-english.xml` overlay. You need them to modify
|
|
64
|
+
LanguageTool and relink a working engine.
|
|
65
|
+
|
|
66
|
+
## OpenJDK and GraalVM source
|
|
67
|
+
|
|
68
|
+
The binary embeds OpenJDK and GraalVM Community runtime code under
|
|
69
|
+
GPLv2 with the Classpath Exception. The corresponding source is
|
|
70
|
+
public: https://github.com/openjdk/jdk and
|
|
71
|
+
https://github.com/oracle/graal. The release SBOM names the versions
|
|
72
|
+
the binary embeds.
|