Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
character: letters,
letter: letters
}
report(file, sentence, threshold, targetAge, [
gradeToAge(daleChallFormula.gradeLevel(daleChallFormula(counts))[1]),
gradeToAge(ari(counts)),
gradeToAge(colemanLiau(counts)),
fleschToAge(flesch(counts)),
smogToAge(smog(counts)),
gradeToAge(gunningFog(counts)),
gradeToAge(spacheFormula(counts))
])
}
return visit.SKIP
function visitor(node) {
var value = toString(node)
var syllables = syllable(value)
wordCount++
totalSyllables += syllables
letters += value.length
caseless = value.toLowerCase()
// Count complex words for gunning-fog based on whether they have three
// or more syllables and whether they aren’t proper nouns. The last is
// checked a little simple, so this index might be over-eager.
if (syllables >= 3) {
polysillabicWord++
}
}
// Apply tags if there are words.
if (values.length !== 0) {
tags = tagger.tag(values)
length = tags.length
index = -1
while (++index < length) {
patch(words[index], tags[index][1])
}
}
// Don’t enter sentences.
return visit.SKIP
}
search(node, normalize, handle)
search(node, noNormalize, handle, true)
// Ignore or emit offending words based on their pattern.
for (key in matches) {
type = byId[key].type
if (type === 'or' && noBinary) {
type = 'simple'
}
handlers[type](matches[key], byId[key], file)
}
return visit.SKIP
// Handle a match.
function handle(match, position, parent, phrase) {
var index = list.indexOf(phrase)
var pattern = byIndex[index]
var id = pattern.id
if (phrase !== phrase.toLowerCase() && toString(match) !== phrase) {
return
}
if (!(id in matches)) {
matches[id] = []
}
matches[id].push({
function visitor(node) {
var first = true
visit(node, check)
return visit.SKIP
function check(node, pos, parent) {
var start = position.start(node)
var value
var index
var line
var cumulative
var indent
if (!applicable(node)) {
return
}
if (!start.line || !node.position.indent) {
first = false
return
function visitor(node) {
if (!generated(node)) {
node.children.forEach(each)
}
return visit.SKIP
}
function onparagraph(node, index, parent) {
if (applicable(node) === containsImage) {
splice.apply(parent.children, [index, 1].concat(node.children))
return [visit.SKIP, index]
}
}
if (pref) {
style = pref === 'padded' ? 1 : 0
} else {
style = entries[0] && (!entries[0].start || !entries[0].end) ? 0 : 1
}
index = -1
length = entries.length
while (++index < length) {
entry = entries[index]
checkSide('start', entry, style, sizes)
checkSide('end', entry, style, sizes)
}
return visit.SKIP
}