unified

Project: retextjs/retext-diacritics

Package: retext-diacritics@3.0.0

  1. Dependencies: 5·Dependents: 8
  2. retext plugin to check for proper use of diacritics
  1. unified 145
  2. plugin 128
  3. retext 33
  4. retext-plugin 21
  5. words 3

retext-diacritics

Build Coverage Downloads Size Sponsors Backers Chat

retext plugin to check for proper use of diacritics.

Install

npm:

npm install retext-diacritics

Use

Say we have the following file, example.txt:

Beyonce is the creme fresh on his resume.

…and our script, example.js, looks like this:

var vfile = require('to-vfile')
var report = require('vfile-reporter')
var unified = require('unified')
var english = require('retext-english')
var stringify = require('retext-stringify')
var diacritics = require('retext-diacritics')

unified()
  .use(english)
  .use(diacritics)
  .use(stringify)
  .process(vfile.readSync('example.txt'), function(err, file) {
    console.error(report(err || 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

retext().use(diacritics[, options])

Check for proper use of diacritics.

options.ignore

Phrases not to warn about (Array.<string>).

Messages

The following VFileMessages are used:

sourceruleIdIncorrectCorrect
retext-diacriticsangstromAngstromÅngström
retext-diacriticsa-la-cartea la carteà la carte
retext-diacriticsa-la-modea la modeà la mode
retext-diacriticsa-resumea resumea résumé
retext-diacriticsacaiacaiaçaí
retext-diacriticsangstromangstromångström
retext-diacriticsbeau-idealbeau idealbeau idéal
retext-diacriticsbeyoncebeyoncebeyoncé
retext-diacriticsboutonniereboutonniereboutonnière
retext-diacriticsbric-a-bracbric-a-bracbric-à-brac
retext-diacriticsbrontebrontebrontë
retext-diacriticscafecafecafé
retext-diacriticscause-celebrecause celebrecause célèbre
retext-diacriticschamps-elyseeschamps-elyseeschamps-Élysées
retext-diacriticschevrechevrechèvre
retext-diacriticscitroencitroencitroën
retext-diacriticsclicheclichecliché
retext-diacriticscomme-ci-comme-cacomme ci comme cacomme ci comme ça
retext-diacriticscomsi-comsacomsi comsacomme ci comme ça
retext-diacriticsconsommeconsommeconsommé
retext-diacriticscoup-d'etatcoup d'etatcoup d'état
retext-diacriticscoup-de-gracecoup de gracecoup de grâce
retext-diacriticscreme-bruleecreme bruleecrème brûlée
retext-diacriticscreme-de-menthecreme de menthecrème de menthe
retext-diacriticscreme-fraicecreme fraicecrème fraîche
retext-diacriticscreme-freshcreme freshcrème fraîche
retext-diacriticscrepecrepecrêpe
retext-diacriticscruditescruditescrudités
retext-diacriticscuracaocuracaocuraçao
retext-diacriticsdebutantedebutantedébutante
retext-diacriticsdecordecordécor
retext-diacriticsdeja-vudeja vudéjà vu
retext-diacriticsdenouementdenouementdénouement
retext-diacriticsdoppelgangerdoppelgangerdoppelgänger
retext-diacriticsel-ninoel ninoel niño
retext-diacriticsemigreemigreémigré
retext-diacriticsfacadefacadefaçade
retext-diacriticsfiancefiancefiancé
retext-diacriticsfianceefianceefiancée
retext-diacriticsfilmjolkfilmjolkfilmjölk
retext-diacriticsflambeflambeflambé
retext-diacriticsfuhrerfuhrerführer
retext-diacriticsgarcongarcongarçon
retext-diacriticsgewurztraminergewurztraminergewürztraminer
retext-diacriticshaagen-dazshaagen dazshäagen-dazs
retext-diacriticshaagen-dazshaagen-dazshäagen-dazs
retext-diacriticsher-resumeher resumeher résumé
retext-diacriticshis-resumehis resumehis résumé
retext-diacriticsjalapenojalapenojalapeño
retext-diacriticsla-ninala ninala niña
retext-diacriticslowenbraulowenbraulöwenbräu
retext-diacriticslyceelyceelycée
retext-diacriticsmaitre-dmaitre dmaître d
retext-diacriticsmenage-a-troismenage a troisménage à trois
retext-diacriticsmonegasquemonegasquemonégasque
retext-diacriticsmotley-cruemotley cruemötley crüe
retext-diacriticsmy-resumemy resumemy résumé
retext-diacriticsnegligeenegligeenégligée
retext-diacriticsnescafenescafenescafé
retext-diacriticspaper-machepaper machepapier-mâché
retext-diacriticspaper-machepaper-machepapier-mâché
retext-diacriticspapier-machepapier-machepapier-mâché
retext-diacriticspina-coladapina coladapiña colada
retext-diacriticsprotegeprotegeprotégé
retext-diacriticsprotegeeprotegeeprotégée
retext-diacriticspureepureepurée
retext-diacriticsquebecquebecquébec
retext-diacriticsquebecoisquebecoisquébécois
retext-diacriticsqueensrychequeensrycheQueensrÿche
retext-diacriticsraison-d'etreraison d'etreraison d'être
retext-diacriticsrisquerisquerisqué
retext-diacriticsroueroueroué
retext-diacriticssenorsenorseñor
retext-diacriticssenorasenoraseñora
retext-diacriticssenoritasenoritaseñorita
retext-diacriticsskodaskodaŠkoda
retext-diacriticssmorgasbordsmorgasbordsmörgåsbord
retext-diacriticssoireesoireesoirée
retext-diacriticssoufflesoufflesoufflé
retext-diacriticssoupconsoupconsoupçon
retext-diacriticstete-a-tetetete-a-tetetête-à-tête
retext-diacriticsthe-resumethe resumethe résumé
retext-diacriticstouchetouchetouché
retext-diacriticsubermenschubermenschÜbermensch
retext-diacriticsvis-a-visvis-a-visvis-à-vis
retext-diacriticsvoilavoilavoilà
retext-diacriticsyour-resumeyour resumeyour résumé

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

Contribute

See contributing.md in retextjs/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer