try this
This commit is contained in:
parent
3e1d6d0cea
commit
3c8c16b73c
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@lingdocs/lingdocs-main",
|
"name": "@lingdocs/lingdocs-main",
|
||||||
"version": "0.2.9",
|
"version": "0.3.0",
|
||||||
"description": "types and functions for lingdocs stuff",
|
"description": "types and functions for lingdocs stuff",
|
||||||
"main": "dist/library.js",
|
"main": "dist/library.js",
|
||||||
"module": "dist/library.js",
|
"module": "dist/library.js",
|
||||||
|
@ -22,13 +22,16 @@
|
||||||
"author": "lingdocs.com",
|
"author": "lingdocs.com",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@lingdocs/pashto-inflector": "2.5.5",
|
||||||
|
"lokijs": "^1.5.12",
|
||||||
"nano": "^9.0.5",
|
"nano": "^9.0.5",
|
||||||
"passport-github2": "^0.1.12",
|
"passport-github2": "^0.1.12",
|
||||||
"passport-google-oauth": "^2.0.0",
|
"passport-google-oauth": "^2.0.0",
|
||||||
"passport-twitter": "^1.0.4",
|
"passport-twitter": "^1.0.4",
|
||||||
"@lingdocs/pashto-inflector": "2.5.5"
|
"supermemo": "^2.0.17"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/lokijs": "^1.5.7",
|
||||||
"@types/passport-github2": "^1.2.5",
|
"@types/passport-github2": "^1.2.5",
|
||||||
"@types/passport-google-oauth": "^1.0.42",
|
"@types/passport-google-oauth": "^1.0.42",
|
||||||
"@types/passport-twitter": "^1.0.37",
|
"@types/passport-twitter": "^1.0.37",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import loki from "lokijs";
|
import loki, { Collection } from "lokijs";
|
||||||
import {
|
import {
|
||||||
Types as T,
|
Types as T,
|
||||||
readDictionary,
|
readDictionary,
|
||||||
|
|
|
@ -111,7 +111,7 @@ function alphabeticalLookup({ searchString, page }: {
|
||||||
{g: { $regex: r }},
|
{g: { $regex: r }},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
const indexNumbers = regexResults.map((mpd) => mpd.i);
|
const indexNumbers = regexResults.map((mpd: any) => mpd.i);
|
||||||
// Find the first matching word occuring first in the Pashto Index
|
// Find the first matching word occuring first in the Pashto Index
|
||||||
let firstIndexNumber = null;
|
let firstIndexNumber = null;
|
||||||
if (indexNumbers.length) {
|
if (indexNumbers.length) {
|
||||||
|
@ -270,7 +270,7 @@ function pashtoFuzzyLookup<S extends T.DictionaryEntry>({ searchString, page, tp
|
||||||
.limit(exactResultsLimit)
|
.limit(exactResultsLimit)
|
||||||
.simplesort("i")
|
.simplesort("i")
|
||||||
.data();
|
.data();
|
||||||
resultsGiven = exactResults.map((mpd) => mpd.$loki);
|
resultsGiven = exactResults.map((mpd: any) => mpd.$loki);
|
||||||
|
|
||||||
// Get fuzzy matches
|
// Get fuzzy matches
|
||||||
const pashtoRegExLogic = fuzzifyPashto(search, {
|
const pashtoRegExLogic = fuzzifyPashto(search, {
|
||||||
|
|
Loading…
Reference in New Issue