1.0.1 • Published 7 years ago

kwrank v1.0.1

Weekly downloads
-
License
Apache-2.0
Repository
gitlab
Last release
7 years ago

kwrank

Donate!

Dumb keyword-based (token-based) search rank lib.

Funcs.

Few formulas.

Strtok: takes string, return list of keywords/tokens. Optional takes separator (, by default). Splits by the separator, trims every entry, filter out empty strings and duplicates, sorts the array

Kwscore: takes two lists of tok, returns int

for each tok in first, if exists in sec then res++

Kwsort: takes a list of objects, and string (tok)

Clone the list, Filter out objects without "keywords" key, computes kwscore for each object (store it as key: score), sorts from highest to lowest kwscore, return sorted list.

1.0.1

7 years ago

1.0.0

7 years ago