Jaxx Morton Posted October 2, 2012 at 12:56 AM Report Posted October 2, 2012 at 12:56 AM 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? Quote
laurenth Posted October 2, 2012 at 07:01 AM Report Posted October 2, 2012 at 07:01 AM If your vocab is in some sort of electronic form, you can import it into Anki (http://ankisrs.net/) and set up Anki to test you on 10 new random words/day. Quote
Jaxx Morton Posted October 2, 2012 at 03:04 PM Author Report Posted October 2, 2012 at 03:04 PM 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. Quote
edelweis Posted October 2, 2012 at 07:40 PM Report Posted October 2, 2012 at 07:40 PM 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 Quote
cababunga Posted October 3, 2012 at 06:17 AM Report Posted October 3, 2012 at 06:17 AM Actually in Linux you can just do: shuf big_list_of_words.txt | head -10 3 Quote
Jaxx Morton Posted October 3, 2012 at 06:18 PM Author Report Posted October 3, 2012 at 06:18 PM 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. Quote
edelweis Posted October 7, 2012 at 09:44 AM Report Posted October 7, 2012 at 09:44 AM It seems ActivePerl also has versions for Mac, but I don't own a Mac so I've never tried that. Quote
imron Posted October 10, 2012 at 08:45 AM Report Posted October 10, 2012 at 08:45 AM 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. Quote
Recommended Posts
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.