README
retext-indefinite-article
retext plugin to check if indefinite articles (a
and an
) are
used correctly.
Install
This package is ESM only:
Node 12+ is needed to use it and it must be import
ed instead of require
d.
npm:
npm install retext-indefinite-article
Use
Say we have the following file, example.txt
:
He should, a 8-year old boy, should have arrived a hour
ago on an European flight. An historic event, or a
historic event? Both are fine.
…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 retextIndefiniteArticle from 'retext-indefinite-article'
import retextStringify from 'retext-stringify'
const file = readSync('example.txt')
unified()
.use(retextEnglish)
.use(retextIndefiniteArticle)
.use(retextStringify)
.process(file)
.then((file) => {
console.error(reporter(file))
})
Now, running node example
yields:
example.txt
1:12-1:13 warning Use `an` before `8-year`, not `a` retext-indefinite-article retext-indefinite-article
1:50-1:51 warning Use `an` before `hour`, not `a` retext-indefinite-article retext-indefinite-article
2:8-2:10 warning Use `a` before `European`, not `an` retext-indefinite-article retext-indefinite-article
⚠ 3 warnings
API
This package exports no identifiers.
The default export is retextIndefiniteArticle
.
unified().use(retextIndefiniteArticle)
Check if indefinite articles (a
and an
) are used correctly (which isn’t as
simple as checking vowels as it has to do with sounds).
Knows about how digits are pronounced as well.
Related
retext-redundant-acronyms
— Check for redundant acronyms (ATM machine
)retext-repeated-words
— Checkfor for
repeated words
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.