=head1 *NAME*perltst5.prl -- language analyzer (perl test 5)=head1 *DESCRIPTION*This program analyzes an arbitrary sample of any language written in
latin characters (a-z). =head1 *TASK*The program should output the following information: 1. Frequency distribution of the vowels and consonants used in the sample. 2. A list of the different consonant-vowel patterns
used in the sample:
A consonant-vowel pattern ("c-w pattern") should have
an 'a' for each vowel, and a 'c' for each consonant;
e.g. the c-w pattern word 'mopufom' would be 'cacacac',
and the c-w pattern for 'oleq' would be 'acac'. 3. The most frequent consonant-vowel pattern in the sample.
=head1 *QUESTION*The sample below consists of two *different* language samples,
pasted one after another.At which point does the second one probably start?
=cut# Note: qw( ) "quotes words": creates an array with the space-separated items @vowels = qw( a e i o u y );
@cons = qw( b c d f g h j k l m n p q r s t v w x z );$/ = undef;
$_ = <DATA>; # All the text is in $_ now.# write the program here:__END__
latin characters (a-z). =head1 *TASK*The program should output the following information: 1. Frequency distribution of the vowels and consonants used in the sample. 2. A list of the different consonant-vowel patterns
used in the sample:
A consonant-vowel pattern ("c-w pattern") should have
an 'a' for each vowel, and a 'c' for each consonant;
e.g. the c-w pattern word 'mopufom' would be 'cacacac',
and the c-w pattern for 'oleq' would be 'acac'. 3. The most frequent consonant-vowel pattern in the sample.
=head1 *QUESTION*The sample below consists of two *different* language samples,
pasted one after another.At which point does the second one probably start?
=cut# Note: qw( ) "quotes words": creates an array with the space-separated items @vowels = qw( a e i o u y );
@cons = qw( b c d f g h j k l m n p q r s t v w x z );$/ = undef;
$_ = <DATA>; # All the text is in $_ now.# write the program here:__END__
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货