I've tried to replicate and extend the first results I got, but I don't seem to be calling this properly. The logic for Getopt::Long seems pretty opaque to me now. Do you see why this is fundamentally different than what worked before?
$ ./2.analyse_text.pl --input-corpus 84-0.txt --ngram-length 4 --outp +ut-state 4.shelley.state args are --input-corpus 84-0.txt --ngram-length 4 --output-state 4.she +lley.state Unknown option: input-corpus Unknown option: ngram-length Unknown option: output-state Usage : ./2.analyse_text.pl <options> Something wrong with command-line parameters... $ cat 2.analyse_text.pl #!/usr/bin/env perl # FILE: analyse_text.pl # by bliako use 5.011; use warnings; use Getopt::Long; use Data::Dump qw/dump/; use lib '.'; use Markov::Ndimensional; my @args = @ARGV; say "args are @args"; my $input_corpus_filename = undef; my $input_state_filename = undef; my $output_state_filename = undef; my $output_stats_filename = undef; my $separator = '\s'; my $internal_separator = '|'; my $seed = undef; my $num_iterations = 100; if( ! Getopt::Long::GetOptions( 'input-state=s' => \$input_state_filename, 'separator=s' => \$separator, 'num-iterations=i' => $num_iterations, 'seed=s' => \$seed, 'help|h' => sub { print STDERR usage($0); exit(0) } ) ){ print STDERR usage($0) . "\n\nSomething wrong with command-line p +arameters...\n"; exit(1); } ...
In reply to Re^5: n-dimensional statistical analysis of DNA sequences (or text, or ...)
by Aldebaran
in thread n-dimensional statistical analysis of DNA sequences (or text, or ...)
by bliako
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |