Jump to content
Chinese-Forums
  • Sign Up

Vocab Test Generator


Recommended Posts

Posted

Hey guys Im trying to find a way that I can generate random vocab tests from a bank of words. Obviously the bank of words would be the words that I know. What I want to happen is a test of like 10 words will be generated from the large bank. Does anybody know a way that i can do this?

Posted

Thanks for the response. I have anki and have put some of my words in but do you know if I could export the test generated by anki to a word document or something. Because i really want to be able to do this test off the computer.

Posted

I would have a text file containing one word or question per line,

then write a program that counts the number of lines in the files and then randomly selects 10 of those. Save that to another text file and print it.

This is not terribly user friendly but not highly technical either.

What's your computer's operating system?

What programming languages are available? (for instance, perl, python, ...)

Do you have Excel? (If so someone may come up with a macro)

If you have Linux with Perl, or Windows with the free ActivePerl for instance, you can try the attached file. Rename it as select_random_lines.pl (it seems I can't attach .pl files directly).

In a command window, go to the directory containing the perl file and the big list of words.

With Linux, type

perl select_random_lines.pl 10 big_list_of_words.txt

With Windows, type

select_random_lines.pl 10 big_list_of_words.txt

It assumes the input file is UTF8. It will automatically create test1.txt, then test2.txt the next time you launch it and so on.

select_random_lines.txt

Posted

Dang actually im using a mac so that wont work for me but thanks alot for the effort. I have a friend writing me a java program to do this right now actually so i guess that will solve my problem. Ill post it when hes done with it incase any other mac users want to be able to do the same thing.

Posted

It seems ActivePerl also has versions for Mac, but I don't own a Mac so I've never tried that.

Posted

OSX is basically Unix with a nice GUI, so more or less all your standard Unix tools can be run on them without any issues.

The perl I have on my system was installed with macports, which is basically apt-get for all the open source Unix tools Apple decided not to install by default.

Edit: And just to confirm, the following command:

perl -MList::Util -e 'print List::Util::shuffle <>' < file.txt | head -10

Works great on this version of perl to randomly shuffle lines in file.txt and show the first 10.

Join the conversation

You can post now and select your username and password later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Click here to reply. Select text to quote.

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...