?? idiom.pl
字號:
LoadIdiom("list",\@IdiomInfo);
GenLinkedIdiom(\@IdiomInfo,\%HashLinkedIdiom);
LinkedIdiom(\%HashLinkedIdiom);
sub LinkedIdiom
{
my ($RefHashLinkedIdiom)=@_;
($MachineIdiom)=keys %{$RefHashLinkedIdiom};
print "Machine:$MachineIdiom\nPls:";
while(1){
$UserIdiom=<stdin>;
chomp($UserIdiom);
$RefLinkedIdiom=$RefHashLinkedIdiom->{$MachineIdiom};
if ( defined ${$RefLinkedIdiom}{$UserIdiom}){
print "OK!\n";
}else{
@AllAnswer=keys %{$RefLinkedIdiom};
if ( @AllAnswer == 0 ){
last;
}
$no=0;
print "All Answer:pls select one by ID:\n";
foreach (@AllAnswer){
print "$no:$_ ";
$no++;
}
print "\n";
$UserIdiom=<stdin>;
$UserIdiom=$AllAnswer[$UserIdiom];
print "you select:$UserIdiom\n";
}
$RefLinkedIdiom=$RefHashLinkedIdiom->{$UserIdiom};
@AllAnswer=keys %{$RefLinkedIdiom};
if ( @AllAnswer == 0 ){
last;
}
($MachineIdiom)=@AllAnswer;
print "Machine:$MachineIdiom\nPls:";
}
}
sub GenLinkedIdiom
{
my ($RefIdiomInfo,$RefHashLInedIdiom)=@_;
foreach $Ref3Ele(@{$RefIdiomInfo}){
$Idiom1=${$Ref3Ele}[0];
$LastPY1=${$Ref3Ele}[2];
foreach $Ref3Ele(@{$RefIdiomInfo}){
$Idiom2=${$Ref3Ele}[0];
$FirstPY2=${$Ref3Ele}[1];
if ( $LastPY1 eq $FirstPY2 ){
${${$RefHashLInedIdiom}{$Idiom1}}{$Idiom2}=1;
}
}
}
}
sub LoadIdiom
{
my($File,$RefIdiomPhrase)=@_;
open(In,"$File");
while(<In>){
chomp;
if (/^(\S+) ([^_]+).*_([^_]+)$/){
my @PhraseInfo=();
push(@PhraseInfo,$1);
push(@PhraseInfo,$2);
push(@PhraseInfo,$3);
push(@$RefIdiomPhrase,\@PhraseInfo);
}
}
close(In);
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -