Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Cedict

An implementation of Cedict using the prefix tree data structure. Each node (except for the root) contains a character, and contains a list of entries formed by the characters in the path from the root to the node. It uses the traditional attribute as the lookup key into the tree.

Hierarchy

  • Cedict

Index

Constructors

constructor

  • new Cedict(filename: string, trad: boolean): Cedict

Properties

Private root

Private traditional

traditional: boolean

Methods

Private gatherEntriesUnderNode

getEntriesStartingWith

  • getEntriesStartingWith(query: string): Entry[]

getMatch

  • getMatch(query: string): Entry[]

Private getNodeForWord

getPrefixEntries

  • getPrefixEntries(query: string): Entry[]
  • E.g. for a query of "我們是" this will return entries for 我 and 我們

    Parameters

    • query: string

    Returns Entry[]

Private insertEntry

  • insertEntry(entry: Entry): void

Private populateTree

  • populateTree(entries: Entry[]): void

Generated using TypeDoc