Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- declare(strict_types = 1);
- use Graphp\GraphViz\GraphViz;
- use drupol\phptree\Node\TrieNode;
- include './vendor/autoload.php';
- $strings = [
- 'value',
- 'breadthfirst',
- 'inorder',
- 'postorder',
- 'preorder',
- 'exporter',
- 'importer',
- 'capacity',
- 'degree',
- 'size',
- 'maximum',
- 'children',
- 'key',
- 'graph',
- 'api',
- 'documentation',
- 'available',
- 'render',
- 'tests',
- 'inspections',
- 'benchmarks',
- 'panoramic',
- 'nifty',
- 'scream',
- 'dispensable',
- 'science',
- 'scale',
- 'efficacious',
- 'cemetery',
- 'daily',
- 'actor',
- 'station',
- 'earn',
- 'whispering',
- 'substantial',
- 'round',
- 'symptomatic',
- 'chess',
- 'pleasant',
- 'cannon',
- 'finicky',
- 'rake',
- 'insidious',
- 'fumbling',
- 'boil',
- 'idiotic',
- 'fierce',
- 'meeting',
- 'trade',
- 'attraction',
- 'deeply',
- 'pass',
- 'loss',
- 'aromatic',
- 'waste',
- 'zoo',
- 'nation',
- 'pet',
- 'cream',
- 'mourn',
- 'smoggy',
- 'manage',
- 'mature',
- 'travel',
- 'reflective',
- 'hushed',
- 'leaf',
- 'trouble',
- 'zonked',
- 'node',
- 'kiss',
- 'feeling',
- 'unequal',
- 'pastoral',
- 'friend',
- 'glorious',
- 'lumpy',
- 'coal',
- 'cowardly',
- 'quiver',
- 'zoom',
- 'macho',
- 'vagabond',
- 'girl',
- 'hanging',
- 'strip',
- 'nutritious',
- 'real',
- 'servant',
- 'needle',
- 'pretend',
- 'dress',
- 'trebuchet',
- 'trebucket',
- 'trecentist',
- 'trecento',
- 'trecentos',
- 'trechmannite',
- 'treckpot',
- 'treckschuyt',
- 'treculia',
- 'treddle',
- 'treddled',
- 'treddles',
- 'treddling',
- 'tredecaphobia',
- 'tredecile',
- 'tredecillion',
- 'tredecillions',
- 'tredecillionth',
- 'tredefowel',
- 'tredille',
- 'tredrille',
- 'tree',
- 'treebeard',
- 'treebine',
- 'tree-bordered',
- 'tree-boring',
- 'treece',
- 'treed',
- 'treefish',
- 'treefishes',
- 'treeful',
- 'treehair',
- 'treehood',
- 'treehopper',
- 'treey',
- 'treeify',
- 'treeiness',
- 'treeing',
- 'treelawn',
- 'treeless',
- 'treelessness',
- 'treelet',
- 'treelike',
- 'treelikeness',
- 'treelined',
- 'treeling',
- 'treemaker',
- 'treemaking',
- 'treeman',
- 'treen',
- 'treenail',
- 'treenails',
- 'treens',
- 'treenware',
- 'trees',
- 'treescape',
- 'treeship',
- 'treespeeler',
- 'treetise',
- 'treetop',
- 'treeward',
- ];
- $trie = new TrieNode('root', 'root');
- foreach ($strings as $key => $word)
- {
- $trie->add(new TrieNode($key, $word));
- }
- $export = new \drupol\phptree\tests\Exporter\KeyValueGraph();
- (new GraphViz())->display($export->export($trie));
Add Comment
Please, Sign In to add comment