mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-28 14:32:38 +03:00
changes to make LMs work in Windows
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@949 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
parent
8d97bce927
commit
e8cd4e752f
@ -61,7 +61,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""$(SolutionDir)\$(ConfigurationName)\moses.lib" "$(SolutionDir)\$(ConfigurationName)\irstlm.lib" zdll.lib"
|
||||
AdditionalDependencies=""$(SolutionDir)\$(ConfigurationName)\moses.lib" "$(SolutionDir)\$(ConfigurationName)\irstlm.lib" zdll.lib "$(SolutionDir)..\srilm\lib\cygwin\libdstruct.a" "$(SolutionDir)..\srilm\lib\cygwin\libflm.a" "$(SolutionDir)..\srilm\lib\cygwin\liblattice.a" "$(SolutionDir)..\srilm\lib\cygwin\liboolm.a" "$(SolutionDir)..\srilm\lib\cygwin\libmisc.a""
|
||||
OutputFile="$(ProjectDir)$(ConfigurationName)\$(ProjectName).exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
@ -137,7 +137,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies=""$(SolutionDir)\$(ConfigurationName)\moses.lib" "$(SolutionDir)\$(ConfigurationName)\irstlm.lib" zdll.lib"
|
||||
AdditionalDependencies=""$(SolutionDir)\$(ConfigurationName)\moses.lib" "$(SolutionDir)\$(ConfigurationName)\irstlm.lib" zdll.lib "$(SolutionDir)..\srilm\lib\cygwin\libdstruct.a" "$(SolutionDir)..\srilm\lib\cygwin\libflm.a" "$(SolutionDir)..\srilm\lib\cygwin\liblattice.a" "$(SolutionDir)..\srilm\lib\cygwin\liboolm.a" "$(SolutionDir)..\srilm\lib\cygwin\libmisc.a""
|
||||
OutputFile="$(ProjectDir)$(ConfigurationName)\$(ProjectName).exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
|
@ -40,7 +40,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\mysqlpp\lib";"$(SolutionDir)..\irstlm\src""
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\mysqlpp\lib";"$(SolutionDir)..\irstlm\src";"$(SolutionDir)..\srilm\misc\src";"$(SolutionDir)..\srilm\dstruct\src";"$(SolutionDir)..\srilm\include";"$(SolutionDir)..\srilm\lm\src""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;LM_IRST;TRACE_ENABLE;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@ -106,7 +106,7 @@
|
||||
InlineFunctionExpansion="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
FavorSizeOrSpeed="1"
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\mysqlpp\lib";"$(SolutionDir)..\irstlm\src""
|
||||
AdditionalIncludeDirectories=""$(SolutionDir)..\mysqlpp\lib";"$(SolutionDir)..\irstlm\src";"$(SolutionDir)..\srilm\misc\src";"$(SolutionDir)..\srilm\dstruct\src";"$(SolutionDir)..\srilm\include";"$(SolutionDir)..\srilm\lm\src""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;LM_IRST;TRACE_ENABLE;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
@ -243,6 +243,10 @@
|
||||
RelativePath=".\src\LanguageModelSkip.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\LanguageModelSRI.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\LatticePath.cpp"
|
||||
>
|
||||
@ -521,6 +525,10 @@
|
||||
RelativePath=".\src\LanguageModelSkip.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\LanguageModelSRI.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\LatticePath.h"
|
||||
>
|
||||
|
@ -63,8 +63,13 @@ void LanguageModelIRST::Load(const std::string &filePath
|
||||
// Open the input file (possibly gzipped) and load the (possibly binary) model
|
||||
InputFileStream inp(filePath);
|
||||
m_lmtb = new lmtable;
|
||||
m_lmtb->load(inp,filePath.c_str(),1);
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
m_lmtb->load(inp);
|
||||
#else
|
||||
m_lmtb->load(inp,filePath.c_str(),1);
|
||||
#endif
|
||||
|
||||
m_lmtb_ng=new ngram(m_lmtb->dict);
|
||||
m_lmtb_size=m_lmtb->maxlevel();
|
||||
|
||||
@ -159,8 +164,10 @@ float LanguageModelIRST::GetValue(const vector<const Word*> &contextFactor, Stat
|
||||
|
||||
const void LanguageModelIRST::CleanUpAfterSentenceProcessing(){
|
||||
cerr << "reset caches and mmap\n";
|
||||
#ifndef WIN32
|
||||
m_lmtb->reset_caches();
|
||||
m_lmtb->reset_mmap();
|
||||
#endif
|
||||
}
|
||||
|
||||
const void LanguageModelIRST::InitializeBeforeSentenceProcessing(){
|
||||
|
Loading…
Reference in New Issue
Block a user