Home Reference Source Test
public class | source

Trie

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

root: *

Method Summary

Public Methods
public

commonPrefixSearch(ss: *): *

Returns an array of all tokens starting with ss.

public

findAllCommonPrefixes(ss: *, node: *, arr: *)

Checks whether a node starts with ss.

public

insert(word: *, score: *, index: *)

Inserts a token into the trie.

Public Constructors

public constructor() source

Public Members

public root: * source

Public Methods

public commonPrefixSearch(ss: *): * source

Returns an array of all tokens starting with ss.

Params:

NameTypeAttributeDescription
ss *

The prefix to match on.

Return:

*

public findAllCommonPrefixes(ss: *, node: *, arr: *) source

Checks whether a node starts with ss.

Params:

NameTypeAttributeDescription
ss *

The prefix.

node *

The node currently being considered.

arr *

An array of the matching tokens uncovered so far.

public insert(word: *, score: *, index: *) source

Inserts a token into the trie.

Params:

NameTypeAttributeDescription
word *
score *
index *