d11 theme
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

31 lines
861 B

import { Trie } from './trie';
export declare function buildTrie(words: Iterable<string>): Trie;
export declare class TrieBuilder {
private count;
private readonly signatures;
private readonly cached;
private readonly transforms;
private _eow;
/** position 0 of lastPath is always the root */
private lastPath;
private tails;
constructor(words?: Iterable<string>);
private set _root(value);
private get _root();
private signature;
private _canBeCached;
private tryCacheFrozen;
private freeze;
private tryToCache;
private storeTransform;
private addChild;
private buildTail;
private _insert;
insertWord(word: string): void;
insert(words: Iterable<string>): void;
/**
* Resets the builder
*/
reset(): void;
build(consolidateSuffixes?: boolean): Trie;
}