Path: blob/main/docs/_static/language_data.js
469 views
/*1* language_data.js2* ~~~~~~~~~~~~~~~~3*4* This script contains the language-specific data used by searchtools.js,5* namely the list of stopwords, stemmer, scorer and splitter.6*7* :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS.8* :license: BSD, see LICENSE for details.9*10*/11var 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"];12/* Non-minified version is copied as a separate JS file, if available */13/**14* Porter Stemmer15*/16var Stemmer = function() {17var step2list = {18ational: 'ate',19tional: 'tion',20enci: 'ence',21anci: 'ance',22izer: 'ize',23bli: 'ble',24alli: 'al',25entli: 'ent',26eli: 'e',27ousli: 'ous',28ization: 'ize',29ation: 'ate',30ator: 'ate',31alism: 'al',32iveness: 'ive',33fulness: 'ful',34ousness: 'ous',35aliti: 'al',36iviti: 'ive',37biliti: 'ble',38logi: 'log'39};40var step3list = {41icate: 'ic',42ative: '',43alize: 'al',44iciti: 'ic',45ical: 'ic',46ful: '',47ness: ''48};49var c = "[^aeiou]"; // consonant50var v = "[aeiouy]"; // vowel51var C = c + "[^aeiouy]*"; // consonant sequence52var V = v + "[aeiou]*"; // vowel sequence53var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>054var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=155var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>156var s_v = "^(" + C + ")?" + v; // vowel in stem57this.stemWord = function (w) {58var stem;59var suffix;60var firstch;61var origword = w;62if (w.length < 3)63return w;64var re;65var re2;66var re3;67var re4;68firstch = w.substr(0,1);69if (firstch == "y")70w = firstch.toUpperCase() + w.substr(1);71// Step 1a72re = /^(.+?)(ss|i)es$/;73re2 = /^(.+?)([^s])s$/;74if (re.test(w))75w = w.replace(re,"$1$2");76else if (re2.test(w))77w = w.replace(re2,"$1$2");78// Step 1b79re = /^(.+?)eed$/;80re2 = /^(.+?)(ed|ing)$/;81if (re.test(w)) {82var fp = re.exec(w);83re = new RegExp(mgr0);84if (re.test(fp[1])) {85re = /.$/;86w = w.replace(re,"");87}88}89else if (re2.test(w)) {90var fp = re2.exec(w);91stem = fp[1];92re2 = new RegExp(s_v);93if (re2.test(stem)) {94w = stem;95re2 = /(at|bl|iz)$/;96re3 = new RegExp("([^aeiouylsz])\\1$");97re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");98if (re2.test(w))99w = w + "e";100else if (re3.test(w)) {101re = /.$/;102w = w.replace(re,"");103}104else if (re4.test(w))105w = w + "e";106}107}108// Step 1c109re = /^(.+?)y$/;110if (re.test(w)) {111var fp = re.exec(w);112stem = fp[1];113re = new RegExp(s_v);114if (re.test(stem))115w = stem + "i";116}117// Step 2118re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;119if (re.test(w)) {120var fp = re.exec(w);121stem = fp[1];122suffix = fp[2];123re = new RegExp(mgr0);124if (re.test(stem))125w = stem + step2list[suffix];126}127// Step 3128re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;129if (re.test(w)) {130var fp = re.exec(w);131stem = fp[1];132suffix = fp[2];133re = new RegExp(mgr0);134if (re.test(stem))135w = stem + step3list[suffix];136}137// Step 4138re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;139re2 = /^(.+?)(s|t)(ion)$/;140if (re.test(w)) {141var fp = re.exec(w);142stem = fp[1];143re = new RegExp(mgr1);144if (re.test(stem))145w = stem;146}147else if (re2.test(w)) {148var fp = re2.exec(w);149stem = fp[1] + fp[2];150re2 = new RegExp(mgr1);151if (re2.test(stem))152w = stem;153}154// Step 5155re = /^(.+?)e$/;156if (re.test(w)) {157var fp = re.exec(w);158stem = fp[1];159re = new RegExp(mgr1);160re2 = new RegExp(meq1);161re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");162if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))163w = stem;164}165re = /ll$/;166re2 = new RegExp(mgr1);167if (re.test(w) && re2.test(w)) {168re = /.$/;169w = w.replace(re,"");170}171// and turn initial Y back to y172if (firstch == "y")173w = firstch.toLowerCase() + w.substr(1);174return w;175}176}177178179