Git Product home page Git Product logo

Comments (3)

roysti10 avatar roysti10 commented on May 28, 2024 1

How about storing it as a trie or Radix Tree

from toipe.

roysti10 avatar roysti10 commented on May 28, 2024 1

@Samyak2 I think my suggestion is a little wrong, even though a trie or radix tree might be faster in computation of the random word(not entirely sure of this), If im not wrong, what you want to do is find a way to store the word lists by reducing the size of the file

Taking inspiration from the trie maybe you could store words in the following fashion
where the number represents the number of letters taken from the 0th word and the letters represent the letters to be added
A example taken from below would be <5,t> which amounts to applet by taking the first 5 letters from apple
Note:- // is used a comment

0, apple
5, t  // applet
3, ear //appear 
0, ball
3, d //bald
...
...

Now one drawback in storing it this way would be the extra computation of finding the most recent '0'th word in the series, though it might be that heavy it would be nice to avoid it altogether. A variation of the above in storing it could be

0, 0, apple
5, 1, t
3, 2, ear
0, 0, ball
3, 1, d

Where the second integer represents number of steps to the 0th word

And as for random words in tries this might help

from toipe.

Samyak2 avatar Samyak2 commented on May 28, 2024

How about storing it as a trie or Radix Tree

@lucasace that's a good way to compress the data. Although, I'm not sure if it will help in selecting random words in a uniform manner from the list. Do you have any ideas about implementing that in a trie or a radix tree?

from toipe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.