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
|
<Tool
|
||||||
Name="VCLinkerTool"
|
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"
|
OutputFile="$(ProjectDir)$(ConfigurationName)\$(ProjectName).exe"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
@ -137,7 +137,7 @@
|
|||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
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"
|
OutputFile="$(ProjectDir)$(ConfigurationName)\$(ProjectName).exe"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
GenerateDebugInformation="true"
|
GenerateDebugInformation="true"
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
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"
|
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;LM_IRST;TRACE_ENABLE;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
@ -106,7 +106,7 @@
|
|||||||
InlineFunctionExpansion="2"
|
InlineFunctionExpansion="2"
|
||||||
EnableIntrinsicFunctions="true"
|
EnableIntrinsicFunctions="true"
|
||||||
FavorSizeOrSpeed="1"
|
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"
|
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;LM_IRST;TRACE_ENABLE;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE"
|
||||||
RuntimeLibrary="2"
|
RuntimeLibrary="2"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
@ -243,6 +243,10 @@
|
|||||||
RelativePath=".\src\LanguageModelSkip.cpp"
|
RelativePath=".\src\LanguageModelSkip.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\LanguageModelSRI.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\LatticePath.cpp"
|
RelativePath=".\src\LatticePath.cpp"
|
||||||
>
|
>
|
||||||
@ -521,6 +525,10 @@
|
|||||||
RelativePath=".\src\LanguageModelSkip.h"
|
RelativePath=".\src\LanguageModelSkip.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\src\LanguageModelSRI.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\src\LatticePath.h"
|
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
|
// Open the input file (possibly gzipped) and load the (possibly binary) model
|
||||||
InputFileStream inp(filePath);
|
InputFileStream inp(filePath);
|
||||||
m_lmtb = new lmtable;
|
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_ng=new ngram(m_lmtb->dict);
|
||||||
m_lmtb_size=m_lmtb->maxlevel();
|
m_lmtb_size=m_lmtb->maxlevel();
|
||||||
|
|
||||||
@ -159,8 +164,10 @@ float LanguageModelIRST::GetValue(const vector<const Word*> &contextFactor, Stat
|
|||||||
|
|
||||||
const void LanguageModelIRST::CleanUpAfterSentenceProcessing(){
|
const void LanguageModelIRST::CleanUpAfterSentenceProcessing(){
|
||||||
cerr << "reset caches and mmap\n";
|
cerr << "reset caches and mmap\n";
|
||||||
|
#ifndef WIN32
|
||||||
m_lmtb->reset_caches();
|
m_lmtb->reset_caches();
|
||||||
m_lmtb->reset_mmap();
|
m_lmtb->reset_mmap();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
const void LanguageModelIRST::InitializeBeforeSentenceProcessing(){
|
const void LanguageModelIRST::InitializeBeforeSentenceProcessing(){
|
||||||
|
Loading…
Reference in New Issue
Block a user