autocorrect-rb 2.1.1.beta1-x86_64-darwin
Sign up to get free protection for your applications and to get access to all the features.
- 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: 651a37d878b3b87f6570cbc9445d4668403cb72844b7ed1a6a5803587edad1ad
|
4
|
+
data.tar.gz: 609f760e0f1b625214091f66f2d7764b05f3821ec4e84777546f6a940d0f9319
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e9b87ccf96ff85e541e1454f6a4ed7127aeec7e846b9ae922357d85b224744041318413e2366510adda552c65e98ead2f7e4719fab456a5cc3c60136ff8174e7
|
7
|
+
data.tar.gz: b1b4d1e7ac8ba1863ca802976a527af3bde0cd06d4bc457a96bd7ba63d5966cb83ee2d4a34fc7317dd6df05d19ff9554d9c087c68658f02b571ce91cc86016da
|
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: x86_64-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: []
|