<commit_before>/*
 * Load node-goog through Node's standard mechanism, then
 * use Closure's way of importing namespaces.
 */
var goog = require( 'goog' ).goog;
goog.require( 'goog.structs.Trie' );

/*
 * Create a trie and insert some data.
 */
var trie = new goog.structs.Trie();
trie.add( "demo", "node-goog" );
trie.add( "ex", [ "girlfriend", "parrot" ] );
trie.add( "example", { "hello": "world" } );

/*
 * A trie finds the associated data of all prefixes (of 'examples'
 * in this case) in O(L), where L is the length of the key:
 */
console.info( trie.getKeyAndPrefixes( "examples" ) );<commit_msg>updates example to include timer<commit_after>/*
 * Load node-goog through Node's standard mechanism, then
 * use Closure's way of importing namespaces.
 */
var goog = require( 'goog' ).goog;
goog.require( 'goog.async.Delay' );
goog.require( 'goog.structs.Trie' );

/*
 * Create a delayed function which will be executed
 * in 1.5 seconds.
 */
var delay = new goog.async.Delay( function() {
	console.info( "Bye!" );
} ).start( 1500 );

/*
 * Create a trie and insert some data.
 */
var trie = new goog.structs.Trie();
trie.add( "demo", "node-goog" );
trie.add( "ex", [ "girlfriend", "parrot" ] );
trie.add( "example", { "hello": "world" } );

/*
 * A trie finds the associated data of all prefixes (of 'examples'
 * in this case) in O(L), where L is the length of the key:
 */
console.info( trie.getKeyAndPrefixes( "examples" ) );
{'fraction_non_alphanumeric': 0.1672473867595819, 'fraction_numerical': 0.004181184668989547, 'mean_word_length': 3.835016835016835, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '162772', 'n_tokens_mistral': 519, 'n_tokens_neox': 488, 'n_words': 166}