GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - e2yo/eyo-kernel: А node.js module for restoring the letter «ё» (yo) in russian texts

BranchesTags
Open more actions menu

Latest commit

 

History

171 Commits
171 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
dictionary
dictionary
 
 
src
src
 
 
test
test
 
 
tools
tools
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
.npmrc
.npmrc
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
eslint.config.mjs
eslint.config.mjs
 
 
jest.config.mjs
jest.config.mjs
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
rollup.config.mjs
rollup.config.mjs
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

Восстановление буквы «ё» в русских текстах

NPM version NPM downloads

Особенности

  • проверка и восстановление буквы «ё» в русских текстах, вместо написанной «е»;
  • замена «е» на «ё» только в бесспорных случаях;
  • исправление в словах нескольких букв «е», «ё»;
  • корректная обработка сокращений («мед. училище», но не «мёд. училище»);
  • аббревиатуры не обрабатываются.

Установка

npm install eyo-kernel

Зависимости

Отсутствуют.

Использование

import { Eyo, safeDictionary, notSafeDictionary } from 'eyo-kernel';

const text = 'Ежик шел по лесу';

// Работа с безопасным встроенным словарём.
const safeEyo = new Eyo();
safeEyo.dictionary.set(safeDictionary);
console.log(safeEyo.restore(text));
console.log(safeEyo.lint(text));

// Работа с небезопасным встроенным словарём.
const notSafeEyo = new Eyo();
notSafeEyo.dictionary.set(notSafeDictionary);
console.log(notSafeEyo.restore(text));
console.log(notSafeEyo.lint(text));

Словарь

Первоначально словарь взят из проекта php-yoficator. По доработкам словаря см. CHANGELOG.md.

Формат словаря

Это текстовый файл с кодировкой UTF-8, каждое слово на отдельной строке. Слова в словаре чувствительны к регистру букв. Слова, начинающиеся со строчной буквы, заменят в тексте слова со строчной и заглавной букв (Еж → Ёж и еж → ёж). А слова, начинающиеся с заглавной буквы, заменят в тексте слова только с заглавной буквы (Еж → Ёж). Для комментариев используйте символ #.

Отдельные сборки для браузера

  • ./dist/bundle.safe.js: готовый js-скрипт для браузера со встроенным безопасным словарём.
  • ./dist/bundle.notSafe.js: готовый js-скрипт для браузера со встроенным небезопасным словарём.
<script src="https://unpkg.com/eyo-kernel/dist/bundle.safe.js"></script>
<script>
  console.log(window.safeEyo.restore('Ежик шел по лесу'));
  console.log(window.safeEyo.lint('Ежик шел по лесу'));
</script>
<script src="https://unpkg.com/eyo-kernel/dist/bundle.notSafe.js"></script>
<script>
  console.log(window.notSafeEyo.restore('Ежик шел по лесу'));
  console.log(window.notSafeEyo.lint('Ежик шел по лесу'));
</script>

Консольная утилита

Ссылки

  • Типограф с поддержкой данного ёфикатора
  • Веб-интерфейс для восстановления буквы «ё»
  • Консольная утилита
  • http://ru.wikipedia.org/wiki/Ёфикатор
  • Про букву ё
  • Поиск опечаток в тексте

Лицензия

MIT License

About

А node.js module for restoring the letter «ё» (yo) in russian texts

e2yo.github.io/eyo-browser/

Topics

eyojslinternodejsrussiantextyo

Resources

Readme
MIT license
Activity
Custom properties

Stars

47 stars

Watchers

2 watching

Forks

6 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.