autocorrect-rb 2.1.1.beta1-arm64-darwin
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/README.md +39 -0
- data/Rakefile +40 -0
- data/lib/autocorrect/2.7/autocorrect.bundle +0 -0
- data/lib/autocorrect/3.0/autocorrect.bundle +0 -0
- data/lib/autocorrect/3.1/autocorrect.bundle +0 -0
- data/lib/autocorrect-rb.rb +12 -0
- metadata +67 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4d36227abeba9434414b3eeb6de4daf775df08923daa8503d3d1cf5814877667
|
4
|
+
data.tar.gz: cff464fe5e391efdbb2e8ae4cafa14786759ada4ce164a68052929c4fee04262
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2178ed9511fcdeb9efba1fa57ad2fc0ab2c9dd96c0cb118f32aacaccb7f77966dff1db796c16144bb5efde2deada7b59901385fc31b927d9e361a3a6c5eff124
|
7
|
+
data.tar.gz: 20bf3930b581255a8fec5a896fbe4e6f905f0436035823f21831a55bf00f7f2babba407ef55a67e79b650a7d01c0b5a79130f97a0ecfaaa34e3a194001dc30bd
|
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# AutoCorrect for Node.js
|
2
|
+
|
3
|
+
The Native Node.js version of [AutoCorrect](https://github.com/huacnlee/autocorrect) built on [NAPI.RS](https://napi.rs).
|
4
|
+
|
5
|
+
- Rust - [autocorrect](https://github.com/huacnlee/autocorrect)
|
6
|
+
- Ruby - [autocorrect-rb](https://github.com/huacnlee/autocorrect/tree/main/autocorrect-py)
|
7
|
+
- Go - [autocorrect-go](https://github.com/longbridgeapp/autocorrect)
|
8
|
+
- Python - [autocorrect-py](https://github.com/huacnlee/autocorrect/tree/main/autocorrect-py)
|
9
|
+
- Node.js - [autocorrect-node](https://github.com/huacnlee/autocorrect/tree/main/autocorrect-node)
|
10
|
+
- JavaScript (Browser) - [autocorrect-wasm](https://github.com/huacnlee/autocorrect/tree/main/autocorrect-wasm)
|
11
|
+
|
12
|
+
## Installation
|
13
|
+
|
14
|
+
```bash
|
15
|
+
$ yarn add autocorrect-node
|
16
|
+
```
|
17
|
+
|
18
|
+
## Usage
|
19
|
+
|
20
|
+
```js
|
21
|
+
const autocorrect = require('autocorrect-node');
|
22
|
+
|
23
|
+
const out = autocorrect.format('Hello你好.');
|
24
|
+
console.log(out);
|
25
|
+
// Hello 你好。
|
26
|
+
|
27
|
+
out = autocorrect.formatFor("let title = 'Hello你好。'", 'js');
|
28
|
+
// let title = 'Hello 你好。'
|
29
|
+
|
30
|
+
const result = autocorrect.lintFor("let title = 'Hello你好。'", 'js');
|
31
|
+
console.log(result);
|
32
|
+
// {
|
33
|
+
// filepath: 'js',
|
34
|
+
// lines: [
|
35
|
+
// { l: 1, c: 13, new: "'Hello 你好。'", old: "'Hello你好。'", severity: 1 }
|
36
|
+
// ],
|
37
|
+
// error: ''
|
38
|
+
// }
|
39
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
|
3
|
+
begin
|
4
|
+
require "bundler/setup"
|
5
|
+
rescue LoadError
|
6
|
+
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
|
7
|
+
end
|
8
|
+
|
9
|
+
require "bundler/gem_tasks"
|
10
|
+
require "rake/testtask"
|
11
|
+
require "rake/extensiontask"
|
12
|
+
require "bundler"
|
13
|
+
|
14
|
+
CROSS_PLATFORMS = %w[
|
15
|
+
aarch64-linux
|
16
|
+
arm64-darwin
|
17
|
+
x64-mingw32
|
18
|
+
x86_64-darwin
|
19
|
+
x86_64-linux
|
20
|
+
]
|
21
|
+
|
22
|
+
spec = Bundler.load_gemspec("autocorrect-rb.gemspec")
|
23
|
+
|
24
|
+
Rake::TestTask.new(:test) do |t|
|
25
|
+
t.libs << "test"
|
26
|
+
t.libs << "lib"
|
27
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
28
|
+
end
|
29
|
+
|
30
|
+
Rake::ExtensionTask.new("autocorrect") do |ext|
|
31
|
+
ext.gem_spec = spec
|
32
|
+
ext.lib_dir = "lib/autocorrect"
|
33
|
+
ext.source_pattern = "*.{rs,toml}"
|
34
|
+
ext.cross_compile = true
|
35
|
+
ext.cross_platform = CROSS_PLATFORMS
|
36
|
+
end
|
37
|
+
|
38
|
+
task build: :compile
|
39
|
+
task test: :compile
|
40
|
+
task default: %i[compile test]
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,12 @@
|
|
1
|
+
begin
|
2
|
+
# load the precompiled extension file
|
3
|
+
ruby_version = /(\d+\.\d+)/.match(::RUBY_VERSION)
|
4
|
+
require_relative "autocorrect/#{ruby_version}/autocorrect"
|
5
|
+
rescue LoadError
|
6
|
+
# fall back to the extension compiled upon installation.
|
7
|
+
# use "require" instead of "require_relative" because non-native gems will place C extension files
|
8
|
+
# in Gem::BasicSpecification#extension_dir after compilation (during normal installation), which
|
9
|
+
# is in $LOAD_PATH but not necessarily relative to this file
|
10
|
+
# (see https://github.com/sparklemotion/nokogiri/issues/2300 for more)
|
11
|
+
require "autocorrect/autocorrect"
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: autocorrect-rb
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.1.1.beta1
|
5
|
+
platform: arm64-darwin
|
6
|
+
authors:
|
7
|
+
- Jason Lee
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-10-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rb_sys
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.9.18
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.9.18
|
27
|
+
description: AutoCorrect is a linter and formatter to help you to improve copywriting,
|
28
|
+
correct spaces, words, punctuations between CJK (Chinese, Japanese, Korean).
|
29
|
+
email:
|
30
|
+
- huacnlee@gmail.com
|
31
|
+
executables: []
|
32
|
+
extensions: []
|
33
|
+
extra_rdoc_files: []
|
34
|
+
files:
|
35
|
+
- README.md
|
36
|
+
- Rakefile
|
37
|
+
- lib/autocorrect-rb.rb
|
38
|
+
- lib/autocorrect/2.7/autocorrect.bundle
|
39
|
+
- lib/autocorrect/3.0/autocorrect.bundle
|
40
|
+
- lib/autocorrect/3.1/autocorrect.bundle
|
41
|
+
homepage: https://github.com/huacnlee/autocorrect
|
42
|
+
licenses:
|
43
|
+
- MIT
|
44
|
+
metadata: {}
|
45
|
+
post_install_message:
|
46
|
+
rdoc_options: []
|
47
|
+
require_paths:
|
48
|
+
- lib
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '2.7'
|
54
|
+
- - "<"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 3.2.dev
|
57
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.3.1
|
62
|
+
requirements: []
|
63
|
+
rubygems_version: 3.4.0.dev
|
64
|
+
signing_key:
|
65
|
+
specification_version: 4
|
66
|
+
summary: AutoCorrect is a linter and formatter to help you to improve copywriting.
|
67
|
+
test_files: []
|