10-15-2009, 07:46 AM | #1 |
Join Date: Mar 2005
Location: Harrisonburg VA
|
Comprehensive e23 Index
Brett requested a comprehensive index for the Spaceships series on another thread... and realizing that the PDF indexes would let you cut and paste to text files, I decided to write a short perl script to generate a comprehensive index. As this code would be useful for other PDF series as well, I'm posting it here.
Here is the code: Code:
use strict; use warnings; my $previous; my @stuff; while (my $file = shift) { die "Need a proper file name" unless $file =~ /(\w+)/; my $f = $1; open FILE, "< $file" or die "Cannot find file $file: $file"; while (my $line = <FILE>) { chomp($line); #print ":: $line\n"; #do not insert a space into the line if the last #one ended with a dash $previous .= ' ' if $previous && $previous =~ /[^-]$/; $previous .= $line; #if the line ends in a period, insert book #references and remember that complete line if ($line =~ /\.$/){ $previous =~ s/( \d)/ $f$1/g; $previous =~ s/\222/'/g; push (@stuff, $previous); #print "|" . $previous . "|\n"; $previous = ''; } } } foreach my $line (sort @stuff) { print "$line\n"; } It seems to work pretty well. The only issue that I see is for cases where the same entry appears in more than one book. You would want to change those to be a single line with the line numbers concatenated together. Also... some may prefer not to have the volume designator with every single page number. The next step would be for someone to take the text generated by this code and lay it out in a word processor... and maybe save it as a PDF for other people to use. But as that gets into copyright issues and so forth, I will leave that to others to worry about. It took me an hour and a half to write this code and describe my solution here. PS I am currently looking for work. I am an expert .Net platform database application developer with 8 years experience... and I enjoy tinkering with Perl on the side. Contact me via private messages here if you know of any opportunities that might be a good fit for me. I'd like to try working from home, perhaps, but I'm also willing to move. Thanks! |
10-15-2009, 08:16 AM | #2 |
Join Date: Mar 2005
Location: Harrisonburg VA
|
Re: Comprehensive e23 Index
Here is some sample output combining the indexes of Spaceships volume 1 to 5:
Code:
Target size and weapons, IV 35. Tarot-class light carrier, IV 26. Tasks, I 50-54; command, I 50-51; communication, I 53-54; damage control, I 54; engineering, I 51-52; gunnery, I 53; navigation, I 52; NPC, I 54; piloting, I 53; pre-battle, I 51; sensory, I 52-53. Teleport projector, I 18. Thor-class fleet carrier, IV 20. Thrust rating (TR), III 24; calculating, III 25, III 29, III 33; gravity, III 33-34; using, III 28, III 29. Thrust, fractional, III 28. Thunderbird cargo lighters, II 19. Tiger-class frigate, III 18. Time dilation and travel, V 11. Time spent on tasks, V 31. Titan-class heavy space-transport vehicles, II 8. Total energy conversion, I 20, I 23. Towing, I 15, I 66; tractor beams, I 66. Tractor and Graviton Beam Table, III 39. Tractor beams in combat, III 33. Trade, classifications, II 36; factories and, II 33; liner operations, II 34-35; slower-than-light interstellar, II 41; speculative, II 35-39; tramp spaceship operations, II 35; see also Cargo, Freight, Passengers, Spaceports. Tramp freighter, I 6-7. Tramp freighters, II 5-7. Tramp spaceship operations, II 35, II 45. Transfer orbits, V 8. Transport fees, II 31. Travel time, I 38-39. Travel, I 36-38; distances, I 36; Solar System, I 37; transfer orbits, I 38. Trinity-class heavy cruiser, III 12. Tsunami-class strike cruiser, III 13. Tungusku-class drop ship, IV 18. Last edited by Jeffr0; 10-15-2009 at 08:20 AM. |
10-15-2009, 08:45 AM | #3 |
Join Date: Mar 2005
Location: Harrisonburg VA
|
Re: Comprehensive e23 Index
Here's an example index produced by combining Martial Arts ("MA"), Supers ("S"), and Psionic Powers ("PP"):
Code:
Wild Talent ability, PP 46, PP 80. Wild Talent advantage, MA 49. Wild advantages and disadvantages, S 22. Wildcard powers, S 41. Wildcard skills for styles, MA 60. Wildcard skills, S 23, S 36-37, S 41, S 66, S 111; supporting cast and, S 66. Wing Chun style, MA 20, MA 162, MA 203-204. Wireless technique, PP 32. Women in the martial arts, MA 20. Wong Fei-Hung, MA 22. Wong Kei-Ying, MA 22. Working class supers, S 136. World-shaking supers, S 14. Wounds tables, MA 138-139. Wrench (Limb) technique, MA 82, MA 116. Wrench Spine technique, MA 82. Wrenching Journey technique, PP 70. |
10-16-2009, 11:28 PM | #4 | |
Join Date: Apr 2007
Location: Omaha, NE
|
Re: Comprehensive e23 Index
Quote:
Mine currently reads: Code:
perl indexer.pl SS1.txt SS2.txt SS3.txt SS4.txt SS5.txt > Index.txt
__________________
Lee |
|
Tags |
index |
Thread Tools | |
Display Modes | |
|
|