retain lines

This commit is contained in:
Hieu Hoang 2014-03-16 10:20:24 +00:00
parent 5198352ce2
commit 28ccd68c84
4 changed files with 55 additions and 11 deletions

View File

@ -107,7 +107,7 @@ int main(int argc, char** argv)
cerr << "lineTarget=" << lineTarget << endl;
cerr << "lineSource=" << lineSource << endl;
cerr << "lineAlignment=" << lineAlignment << endl;
*/
*/
AlignedSentence *alignedSentence;

View File

@ -40,6 +40,7 @@
</option>
<option id="gnu.cpp.link.option.libs.936233947" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
<listOptionValue builtIn="false" value="z"/>
<listOptionValue builtIn="false" value="rt"/>
<listOptionValue builtIn="false" value="boost_iostreams-mt"/>
<listOptionValue builtIn="false" value="boost_system-mt"/>
<listOptionValue builtIn="false" value="boost_filesystem-mt"/>
@ -124,5 +125,12 @@
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Release">
<resource resourceType="PROJECT" workspacePath="/score"/>
</configuration>
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/score"/>
</configuration>
</storageModule>
</cproject>

View File

@ -28,22 +28,22 @@
<link>
<name>DomainFeature.cpp</name>
<type>1</type>
<location>/home/hieu/workspace/github/mosesdecoder/phrase-extract/DomainFeature.cpp</location>
<location>/disk4/hieu/workspace/github/mosesdecoder.hieu/phrase-extract/DomainFeature.cpp</location>
</link>
<link>
<name>DomainFeature.h</name>
<type>1</type>
<location>/home/hieu/workspace/github/mosesdecoder/phrase-extract/DomainFeature.h</location>
<location>/disk4/hieu/workspace/github/mosesdecoder.hieu/phrase-extract/DomainFeature.h</location>
</link>
<link>
<name>ExtractionPhrasePair.cpp</name>
<type>1</type>
<location>/home/hieu/workspace/github/mosesdecoder/phrase-extract/ExtractionPhrasePair.cpp</location>
<location>/disk4/hieu/workspace/github/mosesdecoder.hieu/phrase-extract/ExtractionPhrasePair.cpp</location>
</link>
<link>
<name>ExtractionPhrasePair.h</name>
<type>1</type>
<location>/home/hieu/workspace/github/mosesdecoder/phrase-extract/ExtractionPhrasePair.h</location>
<location>/disk4/hieu/workspace/github/mosesdecoder.hieu/phrase-extract/ExtractionPhrasePair.h</location>
</link>
<link>
<name>InputFileStream.cpp</name>
@ -88,17 +88,22 @@
<link>
<name>Timer.cpp</name>
<type>1</type>
<location>/home/hieu/workspace/github/mosesdecoder/moses/Timer.cpp</location>
<location>/disk4/hieu/workspace/github/mosesdecoder.hieu/moses/Timer.cpp</location>
</link>
<link>
<name>Timer.h</name>
<type>1</type>
<location>/home/hieu/workspace/github/mosesdecoder/moses/Timer.h</location>
<location>/disk4/hieu/workspace/github/mosesdecoder.hieu/moses/Timer.h</location>
</link>
<link>
<name>Util.cpp</name>
<type>1</type>
<location>/home/hieu/workspace/github/mosesdecoder/moses/Util.cpp</location>
<location>/disk4/hieu/workspace/github/mosesdecoder.hieu/moses/Util.cpp</location>
</link>
<link>
<name>Util.h</name>
<type>1</type>
<location>/disk4/hieu/workspace/github/mosesdecoder.hieu/moses/Util.h</location>
</link>
<link>
<name>exception.cc</name>
@ -128,12 +133,12 @@
<link>
<name>usage.cc</name>
<type>1</type>
<location>/home/hieu/workspace/github/mosesdecoder/util/usage.cc</location>
<location>/disk4/hieu/workspace/github/mosesdecoder.hieu/util/usage.cc</location>
</link>
<link>
<name>usage.hh</name>
<type>1</type>
<location>/home/hieu/workspace/github/mosesdecoder/util/usage.hh</location>
<location>/disk4/hieu/workspace/github/mosesdecoder.hieu/util/usage.hh</location>
</link>
</linkedResources>
</projectDescription>

31
scripts/other/retain-lines.perl Executable file
View File

@ -0,0 +1,31 @@
#!/usr/bin/perl
#retain lines in clean.lines-retained.1
use strict;
use warnings;
binmode(STDIN, ":utf8");
binmode(STDOUT, ":utf8");
binmode(STDERR, ":utf8");
my $retainPath = $ARGV[0];
open(LINE_RETAINED, $retainPath);
my $retainLine = <LINE_RETAINED>;
my $lineNum = 0;
while (my $line = <STDIN>) {
chomp($line);
++$lineNum;
if ($retainLine == $lineNum) {
print "$line\n";
if ($retainLine = <LINE_RETAINED>) {
# do nothing
}
else {
# retained lines is finished.
$retainLine = 0;
}
}
}