All Projects β†’ hcodes β†’ Yaspeller

hcodes / Yaspeller

Licence: mit
πŸ” Search tool typos in the text, files and websites

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Yaspeller

Pylanguagetool
Python Library and CLI for the LanguageTool JSON API
Stars: ✭ 62 (-88.81%)
Mutual labels:  cli, spellcheck
Lexicon
Manipulate DNS records on various DNS providers in a standardized way.
Stars: ✭ 1,028 (+85.56%)
Mutual labels:  cli, yandex
Grim
Grab images from a Wayland compositor
Stars: ✭ 533 (-3.79%)
Mutual labels:  cli
Cli
GitHub’s official command line tool
Stars: ✭ 26,649 (+4710.29%)
Mutual labels:  cli
Socialscan
Python library and CLI for accurately querying username and email usage on online platforms
Stars: ✭ 538 (-2.89%)
Mutual labels:  cli
Standard Version
πŸ† Automate versioning and CHANGELOG generation, with semver.org and conventionalcommits.org
Stars: ✭ 5,806 (+948.01%)
Mutual labels:  cli
Cli
A command-line interface for Hetzner Cloud
Stars: ✭ 542 (-2.17%)
Mutual labels:  cli
Nali
An offline tool for querying IP geographic information and CDN provider.δΈ€δΈͺζŸ₯θ―’IPεœ°η†δΏ‘ζ―ε’ŒCDNζœεŠ‘ζδΎ›ε•†ηš„η¦»ηΊΏη»ˆη«―ε·₯ε…·.
Stars: ✭ 535 (-3.43%)
Mutual labels:  cli
Discline
🐍 A terminal Discord client that you can actually use.
Stars: ✭ 553 (-0.18%)
Mutual labels:  cli
Imgur Screenshot
Take screenshot selection, upload to imgur. + more cool things
Stars: ✭ 540 (-2.53%)
Mutual labels:  cli
Carbon Now Cli
🎨 Beautiful images of your code β€” from right inside your terminal.
Stars: ✭ 5,165 (+832.31%)
Mutual labels:  cli
Goexpect
Expect for Go
Stars: ✭ 538 (-2.89%)
Mutual labels:  cli
Chrome Extension Cli
πŸš€ The CLI for your next Chrome Extension
Stars: ✭ 536 (-3.25%)
Mutual labels:  cli
Typer
Typer, build great CLIs. Easy to code. Based on Python type hints.
Stars: ✭ 6,793 (+1126.17%)
Mutual labels:  cli
Tget
tget is wget for torrents
Stars: ✭ 532 (-3.97%)
Mutual labels:  cli
Sherlock
πŸ”Ž Hunt down social media accounts by username across social networks
Stars: ✭ 28,569 (+5056.86%)
Mutual labels:  cli
F License
Open Source License Key Generation and Verification Tool written in Go
Stars: ✭ 535 (-3.43%)
Mutual labels:  cli
What Anime Cli
β“πŸ–Ό Find the anime scene by image using your terminal
Stars: ✭ 533 (-3.79%)
Mutual labels:  cli
Solidarity
Solidarity is an environment checker for project dependencies across multiple machines.
Stars: ✭ 540 (-2.53%)
Mutual labels:  cli
Prettytable Rs
A rust library to print aligned and formatted tables
Stars: ✭ 552 (-0.36%)
Mutual labels:  cli

yaspeller

NPM version NPM Downloads Coverage Status Dependency Status

This README is also available in Russian.

Search tool typos in the text, files and websites.

Used API Yandex.Speller.

yaspeller

Installation

npm install yaspeller -g

Using CLI

yaspeller [options] <file-or-directory-or-link...>

Using with pre-commit

Add this to your .pre-commit-config.yaml:

- repo: https://github.com/hcodes/yaspeller.git
  rev: '' # Use the sha / tag you want to point at
  hooks:
    - id: yaspeller

Examples

  • yaspeller README.md β€” search typos in the file.
  • yaspeller "*.md" β€” node glob syntax for Windows.
  • yaspeller -e ".md,.html,.txt" ./texts/ β€” finding typos in files in the folder.
  • yaspeller https://ru.wikipedia.org/wiki/%D0%9E%D0%BF%D0%B5%D1%87%D0%B0%D1%82%D0%BA%D0%B0 β€” search typos in the page.
  • yaspeller http://bem.info/sitemap.xml β€” search typos at the addresses specified in the sitemap.xml.
  • echo "Hello, world!" | yaspeller --stdin
  • echo "Hello, world!" | yaspeller --stdin --stdin-filename hello.txt

Options

-f, --format <value>

Formats: plain, html, markdown or auto.
Default: auto.

-l, --lang <value>

Languages: en, ru or uk.
Default: en,ru.

-c, --config <path>

Configuration file path.

-e, --file-extensions <value>

Set file extensions to search for files in a folder.
Example: .md,.htm,.txt.

--dictionary <file>

JSON file for own dictionary.

[
    "someword1", // someword1 = someword1 and Someword1
    "Someword2", // Someword2 = Someword2
    "someword3"
]

Regular expressions are supported:

[
    "unknownword",
    "unknown(W|w)ord[12]?", // unknown(W|w)ord[12]? = unknown(W|w)ord[12]? and Unknown(W|w)ord[12]?
    "Unknown(W|w)ord[34]?" // Unknown(W|w)ord[34]? = Unknown(W|w)ord[34]?
]

Examples:
yaspeller --dictionary my_dict.json .
yaspeller --dictionary my_dict.json:my_dict2.json .

--report <type>

Set type of report: console, html, markdown or json.
Default: console
Example: console,html,custom_report.js

--check-yo

Check the correctness of using the letter β€œΠβ€ (Yo) in Russian texts.

--by-words

Do not use a dictionary environment (context) during the scan.
This is useful in cases where the service is transmitted to the input of a list of individual words.

--find-repeat-words

Highlight repetitions of words, consecutive. For example, I flew to to to Cyprus.

--flag-latin

Flag words, written in Latin, as erroneous.

--ignore-tags <tags>

Ignore HTML tags.
Default: code,kbd,object,samp,script,style,var
Option to formats html andmarkdown.

--ignore-text <regexp>

Remove the text from the scan using regular expressions.

--ignore-capitalization

Ignore the incorrect use of UPPERCASE / lowercase letters, for example, in the word moscow.

--ignore-digits

Ignore words with numbers, such as avp17h4534.

--ignore-latin

Ignore words, written in Latin, for example, madrid.

--ignore-roman-numerals

Ignore Roman numerals I, II, III, ....

--ignore-uppercase

Ignore words written in capital letters.

--ignore-urls

Ignore Internet addresses, email addresses and filenames.

--max-requests <value>

Max count of requests in parallel.
Default: 2.

--no-colors

Clean output without colors.

--only-errors

Output only errors.

--stdin

Process files on <STDIN>. Default: false

--stdin-filename <file>

Specify filename to process <STDIN> as. Used in reports.

--debug

Debug mode.

Configuration

npm install yaspeller --save-dev

Add the text in package.json / scripts:
"yaspeller": "yaspeller .",

To run the linter:
npm run yaspeller

yaspeller is configured using JSON file at the root of the project:

  • .yaspellerrc
  • .yaspellerrc.js
  • .yaspellerrc.json
  • .yaspeller.json
  • package.json, field yaspeller
{
  "excludeFiles": [
    ".git",
    "libs",
    "node_modules",
    "yaspeller"
  ],
  "lang": "ru",
  "fileExtensions": [
    ".md",
    ".css"
  ],
  "dictionary": [
    "someword1"
  ]
}

Advanced example:

{
  "excludeFiles": [
    ".git",
    "yaspeller",
    "node_modules",
    "libs"
  ],
  "format": "html",
  "lang": "en",
  "fileExtensions": [
    ".md",
    ".css"
  ],
  "report": ["console", "html"],
  "dictionary": [
    // JSON comments
    "someword1", // someword1 = someword1 and Someword1
    "Someword2", // Someword2 = Someword2
    "some(w|W)ord[23]", // some(w|W)ord[23] = some(w|W)ord[23] and Some(w|W)ord[23]
    "Some(w|W)ord" // Some(w|W)ord = Some(w|W)ord
  ],
  "ignoreText": [
    "<php\?[^]*?\?>", // Shortly
    ["<php\?[^]*?\?>", "g"] // Longly
  ],
  "ignoreTags": ["code", "script"],
  "ignoreUrls": true,
  "findRepeatWords": true,
  "maxRequests": 5
}
Property  Type Details
format String --format
lang String --lang
excludeFiles Array
fileExtensions Array --file-extension
dictionary Array --dictionary
report Array --report
checkYo Boolean --check-yo
byWords Boolean --by-words
findRepeatWords Boolean --find-repeat-words
flagLatin Boolean --flag-latin
ignoreTags Array --ignore-tags
ignoreText Array --ignore-text
ignoreCapitalization Boolean --ignore-capitalization
ignoreDigits Boolean --ignore-digits
ignoreLatin Boolean --ignore-latin
ignoreRomanNumerals Boolean --ignore-roman-numerals
ignoreUppercase Boolean --ignore-uppercase
ignoreUrls Boolean --ignore-urls
maxRequests Number --max-requests

Ignore text from checking

Ignore a line

var re = /a-z/; // yaspeller ignore
var re = /a-z/; /* yaspeller ignore */
<span>a-z</span> <!-- yaspeller ignore -->

Ignore a block

/* yaspeller ignore:start */
var reUpper = /A-Z/,
    reLower = /a-z/;
/* yaspeller ignore:end */
<!-- yaspeller ignore:start -->
<span>A-Z</span>
<div>a-z</div>
<!-- yaspeller ignore:end -->

Gulp plugin

var gulp = require('gulp'),
    run = require('gulp-run'); // npm install gulp-run --save-dev

gulp.task('yaspeller', function (cb) {
    run('./node_modules/.bin/yaspeller .').exec()
        .on('error', function (err) {
            console.error(err.message);
            cb();
        })
        .on('finish', cb);
});

Grunt plugin

module.exports = function(grunt) {
    grunt.loadNpmTasks('grunt-shell'); // npm install grunt-shell --save-dev
    grunt.initConfig({
        shell: {
            yaspeller: {
                options: {stderr: false},
                command: './node_modules/.bin/yaspeller .'
            }
        }
    });
    grunt.registerTask('lint', ['shell:yaspeller']);
};

Restrictions API Yandex.Speller

Links

License

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].