retext-indefinite-article
retext plugin to check if indefinite articles (a
and an
) are
used correctly.
Install
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:
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 indefiniteArticle = require('retext-indefinite-article')
unified()
.use(english)
.use(indefiniteArticle)
.use(stringify)
.process(vfile.readSync('example.txt'), function(err, file) {
console.error(report(err || 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
retext().use(indefiniteArticle)
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.