alessandro trinca tornidor
commited on
Commit
·
87def91
1
Parent(s):
cfb0022
feat: small changes to make the frontend more similar to the components integrated into lite.koboldai.net
Browse files- static/index.html +1 -1
- static/index.js +2 -3
static/index.html
CHANGED
@@ -46,7 +46,7 @@
|
|
46 |
<div class="display-flex width-50perc margin2px-bottom">
|
47 |
<form id="id-form-sort-by" aria-label="id-form-sort-by">
|
48 |
<fieldset>
|
49 |
-
<legend>
|
50 |
<div>
|
51 |
<input type="radio" id="sort-by-count" aria-label="sort-by-count" name="sort" value="count"/>
|
52 |
<label for="sort-by-count" id="sort-by-count-label" aria-label="sort-by-count-label">Count</label>
|
|
|
46 |
<div class="display-flex width-50perc margin2px-bottom">
|
47 |
<form id="id-form-sort-by" aria-label="id-form-sort-by">
|
48 |
<fieldset>
|
49 |
+
<legend>Sort:</legend>
|
50 |
<div>
|
51 |
<input type="radio" id="sort-by-count" aria-label="sort-by-count" name="sort" value="count"/>
|
52 |
<label for="sort-by-count" id="sort-by-count-label" aria-label="sort-by-count-label">Count</label>
|
static/index.js
CHANGED
@@ -70,7 +70,7 @@ const wordsFrequencyAnalyzers = {
|
|
70 |
// lunr.stemmer
|
71 |
// Copyright (C) 2020 Oliver Nightingale, Code included under the MIT license
|
72 |
// Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt
|
73 |
-
const
|
74 |
let step2list = {
|
75 |
"ational" : "ate",
|
76 |
"tional" : "tion",
|
@@ -244,7 +244,6 @@ const stemmer = (function(){
|
|
244 |
return w;
|
245 |
}
|
246 |
})();
|
247 |
-
const porterStemmer = stemmer
|
248 |
/**
|
249 |
* Filters elements from a list based on specified criteria.
|
250 |
*
|
@@ -317,7 +316,7 @@ function getWordsTokensAndIndexes(wordsTokensList, offsetsTokensList, minLenWord
|
|
317 |
if (cleanedWord.length < minLenWords) return;
|
318 |
|
319 |
// Apply stemming
|
320 |
-
const stem =
|
321 |
if (!wordsStemsDict[stem]) {
|
322 |
wordsStemsDict[stem] = { count: 0, word_prefix: stem, offsets_array: [] };
|
323 |
}
|
|
|
70 |
// lunr.stemmer
|
71 |
// Copyright (C) 2020 Oliver Nightingale, Code included under the MIT license
|
72 |
// Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt
|
73 |
+
const porterStemmer = (function(){
|
74 |
let step2list = {
|
75 |
"ational" : "ate",
|
76 |
"tional" : "tion",
|
|
|
244 |
return w;
|
245 |
}
|
246 |
})();
|
|
|
247 |
/**
|
248 |
* Filters elements from a list based on specified criteria.
|
249 |
*
|
|
|
316 |
if (cleanedWord.length < minLenWords) return;
|
317 |
|
318 |
// Apply stemming
|
319 |
+
const stem = porterStemmer(cleanedWord);
|
320 |
if (!wordsStemsDict[stem]) {
|
321 |
wordsStemsDict[stem] = { count: 0, word_prefix: stem, offsets_array: [] };
|
322 |
}
|