Skip to content

Commit

Permalink
Rebuild. Bump.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexagon committed Mar 29, 2022
1 parent adaa855 commit 03fe14f
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 27 deletions.
24 changes: 14 additions & 10 deletions dist/thinker.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,6 @@
return exported;
}

var stemmer_1 = stemmer;

// Standard suffix manipulations.
var step2list = {
ational: 'ate',
Expand Down Expand Up @@ -583,10 +581,16 @@
var step3 = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
var step4 = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;

// Stem `value`.
// eslint-disable-next-line complexity
/**
* Stem `value`.
*
* @param {string} value
* @returns {string}
*/
function stemmer(value) {
/** @type {boolean} */
var firstCharacterWasLowerCaseY;
/** @type {RegExpMatchArray} */
var match;

value = String(value).toLowerCase();
Expand All @@ -607,17 +611,17 @@
// Step 1a.
if (sfxSsesOrIes.test(value)) {
// Remove last two characters.
value = value.slice(0, value.length - 2);
value = value.slice(0, -2);
} else if (sfxS.test(value)) {
// Remove last character.
value = value.slice(0, value.length - 1);
value = value.slice(0, -1);
}

// Step 1b.
if ((match = sfxEED.exec(value))) {
if (gt0.test(match[1])) {
// Remove last character.
value = value.slice(0, value.length - 1);
value = value.slice(0, -1);
}
} else if ((match = sfxEdOrIng.exec(value)) && vowelInStem.test(match[1])) {
value = match[1];
Expand All @@ -627,7 +631,7 @@
value += 'e';
} else if (sfxMultiConsonantLike.test(value)) {
// Remove last character.
value = value.slice(0, value.length - 1);
value = value.slice(0, -1);
} else if (consonantLike.test(value)) {
// Append `e`.
value += 'e';
Expand Down Expand Up @@ -669,7 +673,7 @@
}

if (sfxLl.test(value) && gt1.test(value)) {
value = value.slice(0, value.length - 1);
value = value.slice(0, -1);
}

// Turn initial `Y` back to `y`.
Expand Down Expand Up @@ -889,7 +893,7 @@
return function ( w ) {
// Dont process stopwords
if ( stopwords[w] === true ) return w;
return stemmer_1( w );
return stemmer( w );
};
}

Expand Down
2 changes: 1 addition & 1 deletion dist/thinker.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/thinker.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/thinker.min.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/thinker.min.mjs.map

Large diffs are not rendered by default.

24 changes: 14 additions & 10 deletions dist/thinker.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,6 @@ function Index(options) {
return exported;
}

var stemmer_1 = stemmer;

// Standard suffix manipulations.
var step2list = {
ational: 'ate',
Expand Down Expand Up @@ -577,10 +575,16 @@ var step2 = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|izati
var step3 = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
var step4 = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;

// Stem `value`.
// eslint-disable-next-line complexity
/**
* Stem `value`.
*
* @param {string} value
* @returns {string}
*/
function stemmer(value) {
/** @type {boolean} */
var firstCharacterWasLowerCaseY;
/** @type {RegExpMatchArray} */
var match;

value = String(value).toLowerCase();
Expand All @@ -601,17 +605,17 @@ function stemmer(value) {
// Step 1a.
if (sfxSsesOrIes.test(value)) {
// Remove last two characters.
value = value.slice(0, value.length - 2);
value = value.slice(0, -2);
} else if (sfxS.test(value)) {
// Remove last character.
value = value.slice(0, value.length - 1);
value = value.slice(0, -1);
}

// Step 1b.
if ((match = sfxEED.exec(value))) {
if (gt0.test(match[1])) {
// Remove last character.
value = value.slice(0, value.length - 1);
value = value.slice(0, -1);
}
} else if ((match = sfxEdOrIng.exec(value)) && vowelInStem.test(match[1])) {
value = match[1];
Expand All @@ -621,7 +625,7 @@ function stemmer(value) {
value += 'e';
} else if (sfxMultiConsonantLike.test(value)) {
// Remove last character.
value = value.slice(0, value.length - 1);
value = value.slice(0, -1);
} else if (consonantLike.test(value)) {
// Append `e`.
value += 'e';
Expand Down Expand Up @@ -663,7 +667,7 @@ function stemmer(value) {
}

if (sfxLl.test(value) && gt1.test(value)) {
value = value.slice(0, value.length - 1);
value = value.slice(0, -1);
}

// Turn initial `Y` back to `y`.
Expand Down Expand Up @@ -883,7 +887,7 @@ function englishStemmer ( stopwords ) {
return function ( w ) {
// Dont process stopwords
if ( stopwords[w] === true ) return w;
return stemmer_1( w );
return stemmer( w );
};
}

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "thinker-fts",
"version": "2.0.4",
"version": "2.0.5",
"description": "Pure Javascript/Node.js in-memory full text search engine.",
"author": "Hexagon <github.com/hexagon>",
"contributors": [
Expand Down

0 comments on commit 03fe14f

Please sign in to comment.