Changeset 1969

Show
Ignore:
Timestamp:
12/03/07 14:27:46 (5 months ago)
Author:
joshr
Message:

made more sensible defaults for min_words_per_file and max_words_per_file.
Also improved Usage() output.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Swishetest/trunk/make_collection

    r1965 r1969  
    1717my $dict='data/C020-words-txt/words-linux-fc1.txt'; 
    1818 
    19 my $min_words_per_file=1
    20 my $max_words_per_file=1
    21 my $num_files=0;    # 0 means one file for each word in dictionary 
     19my $min_words_per_file=100
     20my $max_words_per_file=100
     21my $num_files=1000;    # 0 means one file for each word in dictionary 
    2222my $num_words;      # should be scalar(@words) 
    2323my $base_dir = "";  # empty base_dir means be an -S prog external program 
     
    3232sub Usage { 
    3333    return "make_collection: [--dict=words.txt] [--base_dir=/your/location]\n" . 
    34            "[--min_words_per_file=#] [--max_words_per_file=#] [--num_files=#]\n" . 
    35            "[--verbose] [--englishify] [--filetype=(txt|html|xml)] [--(no)randommode]\n" . 
     34           "  [--min_words_per_file=$min_words_per_file] [--max_words_per_file=$max_words_per_file] [--num_files=$num_files]\n" . 
     35           "  [--verbose] [--englishify] [--filetype=(txt|html|xml)] [--(no)randommode]:\n" . 
    3636           "   Makes a set of (possibly random) xml, html, or txt files based on a dict.\n"; 
    3737} 
     
    5050        "filetype=s" => \$filetype, 
    5151        "verbose!"    => \$verbose 
    52     ) || die "$prog: Couldn't parse options:\n" . Usage(); 
     52    ) || die Usage(); 
    5353 
    5454 
     
    118118            print STDERR "$prog: created $path...\n" if ($verbose && $i % 1000 == 0); 
    119119        } else { 
    120             # act like a swish-e external program 
     120            # act like a swish-e external program. This prints directly to stdout. 
    121121            simple_swishe_progify($parser, "$i.$filetype", $doc, scalar(localtime(time()))); 
    122122        }