retext-diacritics

retext plugin to check for proper use of diacritics

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
retext-diacritics
504.2.09 months ago6 years agoMinified + gzip package size for retext-diacritics in KB

Readme

retext-diacritics
!Buildbuild-badgebuild !Coveragecoverage-badgecoverage !Downloadsdownloads-badgedownloads !Sizesize-badgesize !Sponsorssponsors-badgecollective !Backersbackers-badgecollective !Chatchat-badgechat
retextretext plugin to check for proper use of diacritics.

Install

This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.
npm install retext-diacritics
## Use

Say we have the following file, `example.txt`:

```txt
Beyonce is the creme fresh on his resume.

…and our script, example.js, looks like this:
import {readSync} from 'to-vfile'
import {reporter} from 'vfile-reporter'
import {unified} from 'unified'
import retextEnglish from 'retext-english'
import retextDiacritics from 'retext-diacritics'
import retextStringify from 'retext-stringify'

const file = readSync('example.txt')

unified()
  .use(retextEnglish)
  .use(retextDiacritics)
  .use(retextStringify)
  .process(file)
  .then((file) => {
    console.error(reporter(file))
  })

Now, running node example yields:
example.txt
    1:1-1:8  warning  Replace `Beyonce` with `Beyoncé`            beyonce      retext-diacritics
  1:16-1:27  warning  Replace `creme fresh` with `crème fraîche`  creme-fresh  retext-diacritics
  1:31-1:41  warning  Replace `his resume` with `his résumé`      his-resume   retext-diacritics

⚠ 3 warnings

API

This package exports no identifiers. The default export is retextDiacritics.

unified().use(retextDiacritics[, options])

Check for proper use of diacritics.
options.ignore
Phrases not to warn about (Array.<string>).

Messages

The following VFileMessagemessages are used:

| source | ruleId | Incorrect | Correct | | - | - | - | - | | retext-diacritics | angstrom | Angstrom | Ångström | | retext-diacritics | a-la-carte | a la carte | à la carte | | retext-diacritics | a-la-mode | a la mode | à la mode | | retext-diacritics | a-resume | a resume | a résumé | | retext-diacritics | acai | acai | açaí | | retext-diacritics | angstrom | angstrom | ångström | | retext-diacritics | beau-ideal | beau ideal | beau idéal | | retext-diacritics | beyonce | beyonce | beyoncé | | retext-diacritics | boutonniere | boutonniere | boutonnière | | retext-diacritics | bric-a-brac | bric-a-brac | bric-à-brac | | retext-diacritics | bronte | bronte | brontë | | retext-diacritics | cafe | cafe | café | | retext-diacritics | cause-celebre | cause celebre | cause célèbre | | retext-diacritics | champs-elysees | champs-elysees | champs-Élysées | | retext-diacritics | chevre | chevre | chèvre | | retext-diacritics | citroen | citroen | citroën | | retext-diacritics | cliche | cliche | cliché | | retext-diacritics | comme-ci-comme-ca | comme ci comme ca | comme ci comme ça | | retext-diacritics | comsi-comsa | comsi comsa | comme ci comme ça | | retext-diacritics | consomme | consomme | consommé | | retext-diacritics | coup-d'etat | coup d'etat | coup d'état | | retext-diacritics | coup-de-grace | coup de grace | coup de grâce | | retext-diacritics | creme-brulee | creme brulee | crème brûlée | | retext-diacritics | creme-de-menthe | creme de menthe | crème de menthe | | retext-diacritics | creme-fraice | creme fraice | crème fraîche | | retext-diacritics | creme-fresh | creme fresh | crème fraîche | | retext-diacritics | crepe | crepe | crêpe | | retext-diacritics | crudites | crudites | crudités | | retext-diacritics | curacao | curacao | curaçao | | retext-diacritics | debutante | debutante | débutante | | retext-diacritics | decor | decor | décor | | retext-diacritics | deja-vu | deja vu | déjà vu | | retext-diacritics | denouement | denouement | dénouement | | retext-diacritics | doppelganger | doppelganger | doppelgänger | | retext-diacritics | el-nino | el nino | el niño | | retext-diacritics | emigre | emigre | émigré | | retext-diacritics | facade | facade | façade | | retext-diacritics | fiance | fiance | fiancé | | retext-diacritics | fiancee | fiancee | fiancée | | retext-diacritics | filmjolk | filmjolk | filmjölk | | retext-diacritics | flambe | flambe | flambé | | retext-diacritics | fuhrer | fuhrer | führer | | retext-diacritics | garcon | garcon | garçon | | retext-diacritics | gewurztraminer | gewurztraminer | gewürztraminer | | retext-diacritics | haagen-dazs | haagen dazs | häagen-dazs | | retext-diacritics | haagen-dazs | haagen-dazs | häagen-dazs | | retext-diacritics | her-resume | her resume | her résumé | | retext-diacritics | his-resume | his resume | his résumé | | retext-diacritics | jalapeno | jalapeno | jalapeño | | retext-diacritics | la-nina | la nina | la niña | | retext-diacritics | lowenbrau | lowenbrau | löwenbräu | | retext-diacritics | lycee | lycee | lycée | | retext-diacritics | maitre-d | maitre d | maître d | | retext-diacritics | menage-a-trois | menage a trois | ménage à trois | | retext-diacritics | monegasque | monegasque | monégasque | | retext-diacritics | motley-crue | motley crue | mötley crüe | | retext-diacritics | my-resume | my resume | my résumé | | retext-diacritics | negligee | negligee | négligée | | retext-diacritics | nescafe | nescafe | nescafé | | retext-diacritics | paper-mache | paper mache | papier-mâché | | retext-diacritics | paper-mache | paper-mache | papier-mâché | | retext-diacritics | papier-mache | papier-mache | papier-mâché | | retext-diacritics | pina-colada | pina colada | piña colada | | retext-diacritics | protege | protege | protégé | | retext-diacritics | protegee | protegee | protégée | | retext-diacritics | puree | puree | purée | | retext-diacritics | quebec | quebec | québec | | retext-diacritics | quebecois | quebecois | québécois | | retext-diacritics | queensryche | queensryche | Queensrÿche | | retext-diacritics | raison-d'etre | raison d'etre | raison d'être | | retext-diacritics | risque | risque | risqué | | retext-diacritics | roue | roue | roué | | retext-diacritics | senor | senor | señor | | retext-diacritics | senora | senora | señora | | retext-diacritics | senorita | senorita | señorita | | retext-diacritics | skoda | skoda | Škoda | | retext-diacritics | smorgasbord | smorgasbord | smörgåsbord | | retext-diacritics | soiree | soiree | soirée | | retext-diacritics | souffle | souffle | soufflé | | retext-diacritics | soupcon | soupcon | soupçon | | retext-diacritics | tete-a-tete | tete-a-tete | tête-à-tête | | retext-diacritics | the-resume | the resume | the résumé | | retext-diacritics | touche | touche | touché | | retext-diacritics | ubermensch | ubermensch | Übermensch | | retext-diacritics | vis-a-vis | vis-a-vis | vis-à-vis | | retext-diacritics | voila | voila | voilà | | retext-diacritics | your-resume | your resume | your résumé |

The offending value is stored at message.actual, and the suggested values are stored at message.expected.

Related

— Check apostrophe use in contractions
— Check if indefinite articles (`a`, `an`) are used correctly
— Check for redundant acronyms (`ATM machine`)
— Check `for for` repeated words
— Check spacing (one or two spaces) between sentences
— Check quote and apostrophe usage

Contribute

See contributing.mdcontributing in retextjs/.githubhealth for ways to get started. See support.mdsupport for ways to get help.
This project has a code of conductcoc. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MITlicense © Titus Wormerauthor