Options
All
  • Public
  • Public/Protected
  • All
Menu

A trie data structure.

Hierarchy

  • Trie

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

root

root: TrieNode

Methods

add

  • add(word: string): void
  • Add a word to the trie.

    Parameters

    • word: string

    Returns void

split

  • split(text: string, unknownKey?: string, ignoreTokens?: string[]): string[]
  • Split a text into a sequence of words based on the trie vocabulary.

    Parameters

    • text: string

      A text to split into words

    • Default value unknownKey: string = undefined

      The word used when the word is not found in the trie

    • Default value ignoreTokens: string[] = []

      Words, not in the trie, to not replace by the unknown key.

    Returns string[]

Legend

  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Function
  • Type alias
  • Enumeration
  • Interface

Generated using TypeDoc