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jsDelivr using Terser v5.39.0.\n * Original file: /npm/readability-score@1.0.1/main.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const path = require('path')\nconst syllable = require('syllable')\nconst pluralize = require('pluralize')\nconst punctuationRE = /[\\u2000-\\u206F\\u2E00-\\u2E7F\\\\'!\"#$%&()*+,\\-./:;<=>?@[\\]^_`{|}~]/g\nconst easyWords = require('./easy_words')\nconst easyWordSet = new Set(easyWords)\n\n// extends Math object\nMath.copySign = (x, y) => {\n  return x * (y / Math.abs(y))\n}\nMath.legacyRound = (number, points = 0) => {\n  const p = 10 ** points\n  // return float(math.floor((number * p) + math.copysign(0.5, number))) / p\n  return Math.floor((number * p) + Math.copySign(0.5, number)) / p\n}\n\nclass Readability {\n  static getGradeSuffix (grade) {\n    grade = Math.floor(grade)\n    // poor function fix this, gives { 22th and 23th grade }\n    const gradeMap = {\n      1: 'st',\n      2: 'nd',\n      3: 'rd'\n    }\n    return gradeMap[grade] ? gradeMap[grade] : 'th'\n  }\n  charCount (text, ignoreSpaces = true) {\n    if (ignoreSpaces) text = text.replace(/ /g, '')\n    return text.length\n  }\n  letterCount (text, ignoreSpaces = true) {\n    if (ignoreSpaces) text = text.replace(/ /g, '')\n    return this.removePunctuation(text).length\n  }\n  removePunctuation (text) {\n    text = text.replace(punctuationRE, '')\n    return text\n  }\n  static split (text) {\n    text = text.split(/,| |\\n|\\r/g)\n    text = text.filter(n => n)\n    return text\n  }\n  lexiconCount (text, removePunctuation = true) {\n    if (removePunctuation) text = this.removePunctuation(text)\n    text = text.split(/,| |\\n|\\r/g)\n    text = text.filter(n => n)\n    return text.length\n  }\n  syllableCount (text, lang = 'en-US') {\n    text = text.toLocaleLowerCase(lang)\n    text = this.removePunctuation(text)\n    if (!text) return 0\n    // eventually replace syllable\n    const count = syllable(text)\n    return count //  js lib overs compared to python\n  }\n  sentenceCount (text) {\n    let ignoreCount = 0\n    let sentences = text.split(/ *[.?!]['\")\\]]*[ |\\n](?=[A-Z])/g)\n    for (let sentence of sentences) {\n      if (this.lexiconCount(sentence) <= 2) ignoreCount += 1\n    }\n    const validSentences = sentences.length - ignoreCount\n    return validSentences > 1 ? validSentences : 1\n  }\n  averageSentenceLength (text) {\n    const asl = this.lexiconCount(text) / this.sentenceCount(text)\n    const returnVal = Math.legacyRound(asl, 1)\n    return !isNaN(returnVal) ? returnVal : 0.0\n  }\n  averageSyllablePerWord (text) {\n    const syllables = this.syllableCount(text)\n    const words = this.lexiconCount(text)\n    const syllablePerWord = syllables / words\n    const returnVal = Math.legacyRound(syllablePerWord, 1)\n    return !isNaN(returnVal) ? returnVal : 0.0\n  }\n  averageCharacterPerWord (text) {\n    const charactersPerWord = this.charCount(text) / this.lexiconCount(text)\n    const returnVal = Math.legacyRound(charactersPerWord, 2)\n    return !isNaN(returnVal) ? returnVal : 0.0\n  }\n  averageLetterPerWord (text) {\n    const lettersPerWord = this.letterCount(text) / this.lexiconCount(text)\n    const returnVal = Math.legacyRound(lettersPerWord, 2)\n    return !isNaN(returnVal) ? returnVal : 0.0\n  }\n  averageSentencePerWord (text) {\n    const sentencesPerWord = this.sentenceCount(text) / this.lexiconCount(text)\n    const returnVal = Math.legacyRound(sentencesPerWord, 2)\n    return !isNaN(returnVal) ? returnVal : 0.0\n  }\n  fleschReadingEase (text) {\n    const sentenceLength = this.averageSentenceLength(text)\n    const syllablesPerWord = this.averageSyllablePerWord(text)\n    const flesch = 206.835 - (1.015 * sentenceLength) - (84.6 * syllablesPerWord)\n    const returnVal = Math.legacyRound(flesch, 2)\n    return returnVal\n  }\n  fleschReadingEaseToGrade (score) {\n    if (score < 100 && score >= 90) return 5\n    else if (score < 90 && score >= 80) return 6\n    else if (score < 80 && score >= 70) return 7\n    else if (score < 70 && score >= 60) return 8.5\n    else if (score < 60 && score >= 50) return 11\n    else if (score < 50 && score >= 40) return 13 // college\n    else if (score < 40 && score >= 30) return 15\n    else return 16\n  }\n  fleschKincaidGrade (text) {\n    const sentenceLength = this.averageSentenceLength(text)\n    const syllablePerWord = this.averageSyllablePerWord(text)\n    const flesch = 0.39 * sentenceLength + 11.8 * syllablePerWord - 15.59\n    const returnVal = Math.legacyRound(flesch, 1)\n    return returnVal\n  }\n  polySyllableCount (text) {\n    let count = 0\n    let wrds\n    for (let word of Readability.split(text)) {\n      wrds = this.syllableCount(word)\n      if (wrds >= 3) count += 1\n    }\n    return count\n  }\n  smogIndex (text) {\n    const sentences = this.sentenceCount(text)\n    if (sentences >= 3) {\n      const polySyllab = this.polySyllableCount(text)\n      const smog = 1.043 * (30 * (polySyllab / sentences)) ** 0.5 + 3.1291\n      const returnVal = Math.legacyRound(smog, 1)\n      return !isNaN(returnVal) ? returnVal : 0.0\n    }\n    return 0.0\n  }\n  colemanLiauIndex (text) {\n    const letters = Math.legacyRound(this.averageLetterPerWord(text) * 100, 2)\n    const sentences = Math.legacyRound(this.averageSentencePerWord(text) * 100, 2)\n    const coleman = 0.058 * letters - 0.296 * sentences - 15.8\n    return Math.legacyRound(coleman, 2)\n  }\n  automatedReadabilityIndex (text) {\n    const characters = this.charCount(text)\n    const words = this.lexiconCount(text)\n    const sentences = this.sentenceCount(text)\n\n    const averageCharacterPerWord = characters / words\n    const averageWordPerSentence = words / sentences\n    const readability = (\n      (4.71 * Math.legacyRound(averageCharacterPerWord, 2)) +\n      (0.5 * Math.legacyRound(averageWordPerSentence, 2)) -\n      21.43\n    )\n    const returnVal = Math.legacyRound(readability, 1)\n    return !isNaN(returnVal) ? returnVal : 0.0\n  }\n  linsearWriteFormula (text) {\n    let easyWord = 0\n    let difficultWord = 0\n    let textList = Readability.split(text).slice(0, 100)\n\n    for (let word of textList) {\n      if (this.syllableCount(word) < 3) {\n        easyWord += 1\n      } else {\n        difficultWord += 1\n      }\n    }\n    text = textList.join(' ')\n    let number = (easyWord * 1 + difficultWord * 3) / this.sentenceCount(text)\n    let returnVal = number <= 20 ? (number - 2) / 2 : number / 2\n    returnVal = Math.legacyRound(returnVal, 1)\n    return !isNaN(returnVal) ? returnVal : 0.0\n  }\n  presentTense(word) {\n    // good enough for most long words -- we only care about \"difficult\" words\n    // of two or more syllables anyway.\n    // Doesn't work for words ending in \"e\" that aren't \"easy\"\n    if (word.length < 6)\n      return word\n    if (word.endsWith('ed')) {\n      if (easyWordSet.has(word.slice(0, -1)))\n        return word.slice(0, -1) // \"easy\" word ending in e\n      else\n        return word.slice(0, -2) // assume we remove \"ed\"\n    }\n    if (word.endsWith('ing')) {\n      const suffixIngToE = word.slice(0, -3) + \"e\" // e.g. forcing -> force\n      if (easyWordSet.has(suffixIngToE))\n        return suffixIngToE\n      else\n        return word.slice(0, -3)\n    }\n    return word\n  }\n  difficultWords (text, syllableThreshold = 2) {\n    const textList = text.match(/[\\w=‘’]+/g)\n    const diffWordsSet = new Set()\n    if (textList === null)\n      return diffWordsSet\n    for (let word of textList) {\n      const normalized = this.presentTense(pluralize(word.toLocaleLowerCase(), 1))\n      // console.log(`difficultWords(${word}): norm=${normalized}, `\n      //             `${this.syllableCount(word)} syllables, easy? ${easyWordSet.has(normalized)}`)\n      if (!easyWordSet.has(normalized) && this.syllableCount(word) >= syllableThreshold) {\n        diffWordsSet.add(word)\n      }\n    }\n    return [...diffWordsSet].length\n  }\n  daleChallReadabilityScore (text) {\n    const wordCount = this.lexiconCount(text)\n    const count = wordCount - this.difficultWords(text)\n    const per = (count / wordCount * 100)\n    if (isNaN(per)) return 0.0\n    const difficultWords = 100 - per\n    // console.log('difficult words : ', difficultWords)\n    let score = (0.1579 * difficultWords) + (0.0496 * this.averageSentenceLength(text))\n    if (difficultWords > 5) score += 3.6365\n    return Math.legacyRound(score, 2)\n  }\n  daleChallToGrade (score) {\n    if (score <= 4.9) return 4\n    if (score < 5.9) return 5\n    if (score < 6.9) return 7\n    if (score < 7.9) return 9\n    if (score < 8.9) return 11\n    if (score < 9.9) return 13\n    else return 16\n  }\n  gunningFog (text) {\n    const perDiffWords = (this.difficultWords(text, 3) / this.lexiconCount(text) * 100)\n    const grade = 0.4 * (this.averageSentenceLength(text) + perDiffWords)\n    const returnVal = Math.legacyRound(grade, 2)\n    return !isNaN(returnVal) ? returnVal : 0.0\n  }\n  lix (text) {\n    const words = Readability.split(text)\n    const wordsLen = words.length\n    const longWords = words.filter(wrd => wrd.length > 6).length\n    const perLongWords = longWords * 100 / wordsLen\n    const asl = this.averageSentenceLength(text)\n    const lix = asl + perLongWords\n    return Math.legacyRound(lix, 2)\n  }\n  rix (text) {\n    const words = Readability.split(text)\n    const longWordsCount = words.filter(wrd => wrd.length > 6).length\n    const sentencesCount = this.sentenceCount(text)\n    const rix = longWordsCount / sentencesCount\n    return !isNaN(rix) ? Math.legacyRound(rix, 2) : 0.0\n  }\n  textStandard (text, floatOutput = null) {\n    const grade = []\n    // Appending Flesch Kincaid Grade\n    let lower = Math.legacyRound(this.fleschKincaidGrade(text))\n    let upper = Math.ceil(this.fleschKincaidGrade(text))\n    grade.push(Math.floor(lower))\n    grade.push(Math.floor(upper))\n\n    let score = this.fleschReadingEase(text)\n    let freGrade = this.fleschReadingEaseToGrade(score)\n    grade.push(freGrade)\n\n    // console.log('grade till now: \\n', grade)\n\n    lower = Math.legacyRound(this.smogIndex(text))\n    upper = Math.ceil(this.smogIndex(text))\n    grade.push(Math.floor(lower))\n    grade.push(Math.floor(upper))\n\n    // Appending Coleman_Liau_Index\n    lower = Math.legacyRound(this.colemanLiauIndex(text))\n    upper = Math.ceil(this.colemanLiauIndex(text))\n    grade.push(Math.floor(lower))\n    grade.push(Math.floor(upper))\n\n    // Appending Automated_Readability_Index\n    lower = Math.legacyRound(this.automatedReadabilityIndex(text))\n    upper = Math.ceil(this.automatedReadabilityIndex(text))\n    grade.push(Math.floor(lower))\n    grade.push(Math.floor(upper))\n\n    // console.log('grade till now : 2 : \\n', grade)\n\n    // Appending  Dale_Chall_Readability_Score\n    lower = Math.legacyRound(this.daleChallToGrade(this.daleChallReadabilityScore(text)))\n    upper = Math.ceil(this.daleChallToGrade(this.daleChallReadabilityScore(text)))\n    grade.push(Math.floor(lower))\n    grade.push(Math.floor(upper))\n\n    // Appending linsearWriteFormula\n    lower = Math.legacyRound(this.linsearWriteFormula(text))\n    upper = Math.ceil(this.linsearWriteFormula(text))\n    grade.push(Math.floor(lower))\n    grade.push(Math.floor(upper))\n\n    // Appending Gunning Fog Index\n    lower = Math.legacyRound(this.gunningFog(text))\n    upper = Math.ceil(this.gunningFog(text))\n    grade.push(Math.floor(lower))\n    grade.push(Math.floor(upper))\n\n    // d = Counter(grade)\n    // final_grade = d.most_common(1)\n    // score = final_grade[0][0]\n\n    // if float_output:\n    //     return float(score)\n    // else:\n    //     lower_score = int(score) - 1\n    //     upper_score = lower_score + 1\n    //     return \"{}{} and {}{} grade\".format(\n    //         lower_score, get_grade_suffix(lower_score),\n    //         upper_score, get_grade_suffix(upper_score)\n    //     )\n    // Finding the Readability Consensus based upon all the above tests\n    // console.log('grade List: ', grade)\n    const counterMap = [...new Set(grade)].map(x => [x, grade.filter(y => y === x).length])\n    const finalGrade = counterMap.reduce((x, y) => y[1] >= x[1] ? y : x)\n    score = finalGrade[0]\n    if (floatOutput) return score\n    const lowerScore = Math.floor(score) - 1\n    const upperScore = lowerScore + 1\n    return `${lowerScore}${Readability.getGradeSuffix(lowerScore)} and ${upperScore}${Readability.getGradeSuffix(upperScore)} grade`\n  }\n  textMedian (text) {\n    const grade = []\n    // Appending Flesch Kincaid Grade\n    grade.push(this.fleschKincaidGrade(text))\n\n    const score = this.fleschReadingEase(text)\n    const freGrade = this.fleschReadingEaseToGrade(score)\n    grade.push(freGrade)\n\n    grade.push(this.smogIndex(text))\n\n    // Appending Coleman_Liau_Index\n    grade.push(this.colemanLiauIndex(text))\n\n    // Appending Automated_Readability_Index\n    grade.push(this.automatedReadabilityIndex(text))\n\n    // Appending  Dale_Chall_Readability_Score\n    grade.push(this.daleChallToGrade(this.daleChallReadabilityScore(text)))\n\n    // Appending linsearWriteFormula\n    grade.push(this.linsearWriteFormula(text))\n\n    // Appending Gunning Fog Index\n    grade.push(this.gunningFog(text))\n\n    // compute median\n    grade.sort(function(a, b) { return a - b })\n    let half = Math.floor(grade.length / 2)\n    if (half & 0x1)\n      return (grade[half-1] + grade[half])/2\n    else\n      return grade[half]\n  }\n}\nconst readability = new Readability()\nmodule.exports = readability\n"]}