lyndseybrowning / trie-prefix-tree

Create and modify trie prefix structures and extract word lists including prefixes, anagrams and sub-anagrams
48 stars 14 forks source link

Add ability to get random word #6

Closed fzembow closed 6 years ago

fzembow commented 6 years ago

Implements #5

Taking advantage of the trie structure to quickly get random words.

Also relaxed the constraint that prefixes be non zero-length strings. This way, getWords and getPrefix can reuse the same backing implementation.

codecov-io commented 6 years ago

Codecov Report

Merging #6 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master     #6   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           7      8    +1     
  Lines         112    122   +10     
  Branches       30     33    +3     
=====================================
+ Hits          112    122   +10
Impacted Files Coverage Δ
src/recurseRandomWord.js 100% <100%> (ø)
src/index.js 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 21bedf5...ef35626. Read the comment docs.

lyndseybrowning commented 6 years ago

This looks good but I'd like to review properly later :)

lyndseybrowning commented 6 years ago

@fzembow Are you able to make the requested changes? I'm happy to make them if you are unable to do so as I'd like to get these changes merged in :)

fzembow commented 6 years ago

@lyndseybrowning my apologies, in the intervening period I left my job and moved apartments so just getting back into things now :)

Addressed your changes, let me know if you see any other issues.

Cheers, f

lyndseybrowning commented 6 years ago

Lovely, looks good. Thanks 👍