Comparing version 10.0.0 to 10.0.1
# Changelog | ||
## v10.0.1 | ||
- Fix `TypeError: Cannot read properties of undefined (reading 'length')` #199 | ||
## v10.0.0 | ||
@@ -4,0 +7,0 @@ - Update major `yandex-speller` package. |
@@ -24,2 +24,27 @@ 'use strict'; | ||
/* TODO: Incorrect API response | ||
1. Japanese and Chinese characters are not supported. | ||
2. In response with code ERROR_TOO_MANY_ERRORS, the whole text is returned instead of the word. | ||
{ | ||
"err": false, | ||
"data": [ | ||
{ | ||
"code": 4, | ||
"pos": 0, | ||
"row": 0, | ||
"col": 0, | ||
"len": 10, | ||
"word": " こんにちは、世界!", | ||
"s": [ | ||
" こんにちは、世界!" | ||
] | ||
} | ||
] | ||
} | ||
Temporarily ignoring this type of error. | ||
*/ | ||
data.data = yaspeller.filterIncorrectTypos(data.data); | ||
yaspeller.addPositions(originalText, data.data); | ||
@@ -26,0 +51,0 @@ yaspeller.sortByPositions(data.data); |
@@ -535,3 +535,11 @@ 'use strict'; | ||
function filterIncorrectTypos(data) { | ||
return data.filter(item => { | ||
const isIncorrectTypo = Boolean(item.code === yaspellerApi.ERROR_TOO_MANY_ERRORS && item.word); | ||
return !isIncorrectTypo; | ||
}); | ||
} | ||
module.exports = { | ||
filterIncorrectTypos, | ||
addPositions, | ||
@@ -538,0 +546,0 @@ errors: getErrors(), |
@@ -13,3 +13,3 @@ { | ||
"description": "Search tool typos in the text, files and websites", | ||
"version": "10.0.0", | ||
"version": "10.0.1", | ||
"license": "MIT", | ||
@@ -16,0 +16,0 @@ "homepage": "https://github.com/hcodes/yaspeller", |
@@ -36,3 +36,2 @@ yaspeller | ||
### Examples | ||
@@ -99,12 +98,5 @@ + `yaspeller README.md` — search typos in the file. | ||
#### `--by-words` | ||
Do not use a dictionary environment (context) during the scan.<br/> | ||
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>` | ||
@@ -124,11 +116,2 @@ Ignore HTML tags.<br/> | ||
#### `--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` | ||
@@ -240,4 +223,2 @@ Ignore Internet addresses, email addresses and filenames. | ||
| `ignoreDigits` | `Boolean` | [`--ignore-digits`](#--ignore-digits) | | ||
(#--ignore-roman-numerals) | | ||
| `ignoreUppercase` | `Boolean` | [`--ignore-uppercase`](#--ignore-uppercase) | | ||
| `ignoreUrls` | `Boolean` | [`--ignore-urls`](#--ignore-urls) | | ||
@@ -244,0 +225,0 @@ | `maxRequests` | `Number` | [`--max-requests`](#--max-requests-value) | |
@@ -90,12 +90,5 @@ yaspeller | ||
#### `--by-words` | ||
Не использовать словарное окружение (контекст) при проверке.<br/> | ||
Опция полезна в случаях, когда на вход сервиса передаётся список отдельных слов. | ||
#### `--find-repeat-words` | ||
Находить повторы слов, идущие подряд. Например, `я полетел на на Кипр`. | ||
#### `--flag-latin` | ||
Отмечать слова, написанные латиницей, как ошибочные. | ||
#### `--ignore-tags <tags>` | ||
@@ -115,11 +108,2 @@ Игнорировать HTML-теги.<br/> | ||
#### `--ignore-latin` | ||
Пропускать слова, написанные латиницей, например, `madrid`. | ||
#### `--ignore-roman-numerals` | ||
Игнорировать римские цифры `I, II, III, ...`. | ||
#### `--ignore-uppercase` | ||
Пропускать слова, написанные заглавными буквами, например, `ВПК`. | ||
#### `--ignore-urls` | ||
@@ -126,0 +110,0 @@ Пропускать интернет-адреса, почтовые адреса и имена файлов. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2329
95640
289