From 978eb0c4aa27492f237378ab48bd8b1a0ef6c73d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 12:57:18 +0000 Subject: [PATCH] style(pre-commit): auto fixes from pre-commit.com hooks --- docs/_static/language_data.js | 180 ++++++++++++++++++---------------- 1 file changed, 98 insertions(+), 82 deletions(-) diff --git a/docs/_static/language_data.js b/docs/_static/language_data.js index 9b5aee6c60..46ab2d3181 100644 --- a/docs/_static/language_data.js +++ b/docs/_static/language_data.js @@ -10,59 +10,91 @@ * */ -var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"]; - +var stopwords = [ + "a", + "and", + "are", + "as", + "at", + "be", + "but", + "by", + "for", + "if", + "in", + "into", + "is", + "it", + "near", + "no", + "not", + "of", + "on", + "or", + "such", + "that", + "the", + "their", + "then", + "there", + "these", + "they", + "this", + "to", + "was", + "will", + "with", +]; /* Non-minified version is copied as a separate JS file, if available */ /** * Porter Stemmer */ -var Stemmer = function() { - +var Stemmer = function () { var step2list = { - ational: 'ate', - tional: 'tion', - enci: 'ence', - anci: 'ance', - izer: 'ize', - bli: 'ble', - alli: 'al', - entli: 'ent', - eli: 'e', - ousli: 'ous', - ization: 'ize', - ation: 'ate', - ator: 'ate', - alism: 'al', - iveness: 'ive', - fulness: 'ful', - ousness: 'ous', - aliti: 'al', - iviti: 'ive', - biliti: 'ble', - logi: 'log' + ational: "ate", + tional: "tion", + enci: "ence", + anci: "ance", + izer: "ize", + bli: "ble", + alli: "al", + entli: "ent", + eli: "e", + ousli: "ous", + ization: "ize", + ation: "ate", + ator: "ate", + alism: "al", + iveness: "ive", + fulness: "ful", + ousness: "ous", + aliti: "al", + iviti: "ive", + biliti: "ble", + logi: "log", }; var step3list = { - icate: 'ic', - ative: '', - alize: 'al', - iciti: 'ic', - ical: 'ic', - ful: '', - ness: '' + icate: "ic", + ative: "", + alize: "al", + iciti: "ic", + ical: "ic", + ful: "", + ness: "", }; - var c = "[^aeiou]"; // consonant - var v = "[aeiouy]"; // vowel - var C = c + "[^aeiouy]*"; // consonant sequence - var V = v + "[aeiou]*"; // vowel sequence + var c = "[^aeiou]"; // consonant + var v = "[aeiouy]"; // vowel + var C = c + "[^aeiouy]*"; // consonant sequence + var V = v + "[aeiou]*"; // vowel sequence - var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 - var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 - var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 - var s_v = "^(" + C + ")?" + v; // vowel in stem + var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 + var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 + var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 + var s_v = "^(" + C + ")?" + v; // vowel in stem this.stemWord = function (w) { var stem; @@ -70,26 +102,22 @@ var Stemmer = function() { var firstch; var origword = w; - if (w.length < 3) - return w; + if (w.length < 3) return w; var re; var re2; var re3; var re4; - firstch = w.substr(0,1); - if (firstch == "y") - w = firstch.toUpperCase() + w.substr(1); + firstch = w.substr(0, 1); + if (firstch == "y") w = firstch.toUpperCase() + w.substr(1); // Step 1a re = /^(.+?)(ss|i)es$/; re2 = /^(.+?)([^s])s$/; - if (re.test(w)) - w = w.replace(re,"$1$2"); - else if (re2.test(w)) - w = w.replace(re2,"$1$2"); + if (re.test(w)) w = w.replace(re, "$1$2"); + else if (re2.test(w)) w = w.replace(re2, "$1$2"); // Step 1b re = /^(.+?)eed$/; @@ -99,10 +127,9 @@ var Stemmer = function() { re = new RegExp(mgr0); if (re.test(fp[1])) { re = /.$/; - w = w.replace(re,""); + w = w.replace(re, ""); } - } - else if (re2.test(w)) { + } else if (re2.test(w)) { var fp = re2.exec(w); stem = fp[1]; re2 = new RegExp(s_v); @@ -111,14 +138,11 @@ var Stemmer = function() { re2 = /(at|bl|iz)$/; re3 = new RegExp("([^aeiouylsz])\\1$"); re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); - if (re2.test(w)) - w = w + "e"; + if (re2.test(w)) w = w + "e"; else if (re3.test(w)) { re = /.$/; - w = w.replace(re,""); - } - else if (re4.test(w)) - w = w + "e"; + w = w.replace(re, ""); + } else if (re4.test(w)) w = w + "e"; } } @@ -128,19 +152,18 @@ var Stemmer = function() { var fp = re.exec(w); stem = fp[1]; re = new RegExp(s_v); - if (re.test(stem)) - w = stem + "i"; + if (re.test(stem)) w = stem + "i"; } // Step 2 - re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + re = + /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; suffix = fp[2]; re = new RegExp(mgr0); - if (re.test(stem)) - w = stem + step2list[suffix]; + if (re.test(stem)) w = stem + step2list[suffix]; } // Step 3 @@ -150,26 +173,23 @@ var Stemmer = function() { stem = fp[1]; suffix = fp[2]; re = new RegExp(mgr0); - if (re.test(stem)) - w = stem + step3list[suffix]; + if (re.test(stem)) w = stem + step3list[suffix]; } // Step 4 - re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + re = + /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; re2 = /^(.+?)(s|t)(ion)$/; if (re.test(w)) { var fp = re.exec(w); stem = fp[1]; re = new RegExp(mgr1); - if (re.test(stem)) - w = stem; - } - else if (re2.test(w)) { + if (re.test(stem)) w = stem; + } else if (re2.test(w)) { var fp = re2.exec(w); stem = fp[1] + fp[2]; re2 = new RegExp(mgr1); - if (re2.test(stem)) - w = stem; + if (re2.test(stem)) w = stem; } // Step 5 @@ -180,25 +200,22 @@ var Stemmer = function() { re = new RegExp(mgr1); re2 = new RegExp(meq1); re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); - if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) - w = stem; + if (re.test(stem) || (re2.test(stem) && !re3.test(stem))) w = stem; } re = /ll$/; re2 = new RegExp(mgr1); if (re.test(w) && re2.test(w)) { re = /.$/; - w = w.replace(re,""); + w = w.replace(re, ""); } // and turn initial Y back to y - if (firstch == "y") - w = firstch.toLowerCase() + w.substr(1); + if (firstch == "y") w = firstch.toLowerCase() + w.substr(1); return w; - } -} - + }; +}; -"use-strict"; +("use-strict"); let queryBeingDone = null; let pattern = null; @@ -280,4 +297,3 @@ document.addEventListener("DOMContentLoaded", () => { pattern = new RegExp(pattern, "i"); } }); -