N
N
naso4ek2015-03-26 20:17:57
Text Processing Automation
naso4ek, 2015-03-26 20:17:57

How to search for random words from lists?

Hello everyone
. You need to search for random words from lists, on request.
For example, I write the word "Internet" into the program window.
And it looks for me random words from several lists that are made alphabetically (1 list per 1 letter in the alphabet)
That is, in list with the letter A there will be adjectives with the letter A (Athletic, Artistic, etc.)
And so, the program should find any random words for the word "Internet" with the letters I, N, T, E, P, H, E, T

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sivabur, 2015-04-02
@sivabur

1. A file with a dictionary.
2. Read everything into a 2D array. To be something like this
3.[0] -letter alphabetically
[1]-word starting with a certain letter starting from the very first one.
4. And then cycle through the entered word.
And in the loop:
Select an array according to the letter, count the number of words in beginning with this letter. And randomly starting from 0 to the number of words for this letter, print the word.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question