function buildTrieFromTracks(tracks) {
    var T = new Trie();

    // build trie
    tracks.forEach((track, trackIndex) => {
        // magic
        var trackReplaced = track.name.replace(/(,|no\.|\.|:)/gi, ' ');
        var word = trackReplaced.split(/\s+/);

        T.insert(word, trackIndex, track);
    });

    T.mergeNames();
    return T.getNodes();
}
// bulid trie from list of tracks
bulid trie from list of tracks
bulid trie from list of tracks
function buildTrieFromTracks(tracks) {
    var T = new Trie();
    tracks.forEach((track, trackIndex) => {
        var trackReplaced = track.name.replace(/(,|no\.|\.|:)/gi, ' ');
        var word = trackReplaced.split(/\s+/);
        T.insert(word, trackIndex, track);
    });
    T.mergeNames();
    return T.getNodes();
}
function buildTrieFromTracks ( tracks ) { var T = new Trie ( ) ; tracks . forEach ( ( track , trackIndex ) => { var trackReplaced = track . name . replace ( / (,|no\.|\.|:) / gi , ' ' ) ; var word = trackReplaced . split ( / \s+ / ) ; T . insert ( word , trackIndex , track ) ; } ) ; T . mergeNames ( ) ; return T . getNodes ( ) ; }
bulid trie from list of tracks
bulid trie from list of tracks
// build trie // magic