📄 extract-factors.pl.svn-base
字号:
#!/usr/bin/perl -w# $Id$#extract-factors.pl: extract only the desired factors from a factored corpus#usage: extract-factors corpusfile factor-index factor-index ... > outfile#factor indices start at 0#factor indices too large ought to be ignoreduse strict;my ($filename, @factors) = @ARGV;my %indices = map {$_ => 1} @factors;open(INFILE, "<$filename") or die "couldn't open '$filename' for read: $!\n";while(my $line = <INFILE>){ chop $line; print join(' ', map {my $i = 0; join('|', grep($indices{$i++}, split(/\|/, $_)))} split(/\s+/, $line)) . "\n";}close(INFILE);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -