server / Modules / search / Search

Class: Search

search.Search

Search is a singleton containing the search algorithm It is used to find the suggestions

Constructors

constructor

new Search()

Methods

findWords

findWords(«destructured»): Promise<SearchResult>

Entry point of the search algo

Parameters

NameType
«destructured»Object
› coordVec
› dirDirection
› gridGrid
› method"simple" | "fastest"

Returns

Promise<SearchResult>

Defined in

search/index.ts:265open in new window


getBestWords

getBestWords(«destructured»): Object

Returns all the words that would not block the grid on next step

Parameters

NameType
«destructured»Object
› dirDirection
› gridGrid
› lemmesLemme[]
› lengthnumber
› startPoint
› wordsstring[]

Returns

Object

a list of words that match the perpandicular lemmes

NameType
impossiblePoint[]
wordsstring[]

Defined in

search/index.ts:27open in new window


getLemmes

Static getLemmes(«destructured»): any[]

Given a position and a direction, get all the lemmes Usefull for search algo

Parameters

NameType
«destructured»Object
› coordPoint
› dirDirection
› gridGrid
› wordLengthnumber

Returns

any[]

A list of lemmes of length 2 and 3

Defined in

search/index.ts:171open in new window