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.
 
 
 

37 lines
1.1 KiB

import { TrieNode } from './TrieNode';
export declare const JOIN_SEPARATOR = "+";
export declare const WORD_SEPARATOR = " ";
export interface YieldResult {
text: string;
node: TrieNode;
depth: number;
}
export declare enum CompoundWordsMethod {
/**
* Do not compound words.
*/
NONE = 0,
/**
* Create word compounds separated by spaces.
*/
SEPARATE_WORDS = 1,
/**
* Create word compounds without separation.
*/
JOIN_WORDS = 2
}
export declare type WalkerIterator = Generator<YieldResult, any, boolean | undefined>;
/**
* Walks the Trie and yields a value at each node.
* next(goDeeper: boolean):
*/
export declare function walker(root: TrieNode, compoundingMethod?: CompoundWordsMethod): WalkerIterator;
export interface Hinting {
goDeeper: boolean;
}
export declare type HintedWalkerIterator = Generator<YieldResult, any, Hinting | undefined>;
/**
* Walks the Trie and yields a value at each node.
* next(goDeeper: boolean):
*/
export declare function hintedWalker(root: TrieNode, compoundingMethod: CompoundWordsMethod | undefined, hint: string): HintedWalkerIterator;