diff options
author | bhaddow <bhaddow@staffmail.ed.ac.uk> | 2011-08-22 17:52:02 +0400 |
---|---|---|
committer | bhaddow <bhaddow@staffmail.ed.ac.uk> | 2011-08-22 17:52:02 +0400 |
commit | 1f3c11b441653ff205e2407caddcd36ab369b2c3 (patch) | |
tree | b223d70b650ac939a9dee78308ce374c3ae57cd4 /moses-chart-cmd | |
parent | 898d67af8242284706bde1c232917e6898ebbdfd (diff) | |
parent | 96417949c2f3d85b535e81c1d1358752b93c00be (diff) |
Merge branch 'master' into miramerge
Passes all regression except for the score tests, as I still have to merge
in the missing files for these tests.
Conflicts:
.gitignore
Makefile.am
configure.in
moses-chart/moses-chart.xcodeproj/project.pbxproj
moses/src/ChartHypothesis.cpp
moses/src/ChartTranslationOptionCollection.cpp
moses/src/ChartTrellisPath.cpp
moses/src/DotChart.cpp
moses/src/LMList.h
moses/src/LanguageModel.cpp
moses/src/LanguageModel.h
moses/src/LanguageModelFactory.cpp
moses/src/LanguageModelRemote.h
moses/src/LexicalReordering.h
moses/src/Makefile.am
moses/src/Manager.cpp
moses/src/Parameter.cpp
moses/src/RuleCubeQueue.h
moses/src/ScoreIndexManager.cpp
moses/src/StaticData.cpp
moses/src/StaticData.h
moses/src/TargetPhrase.cpp
moses/src/TargetPhrase.h
moses/src/TranslationOptionCollection.cpp
Diffstat (limited to 'moses-chart-cmd')
-rw-r--r-- | moses-chart-cmd/moses-chart-cmd.vcproj | 228 | ||||
-rw-r--r-- | moses-chart-cmd/moses-chart-cmd.vcxproj | 117 | ||||
-rw-r--r-- | moses-chart-cmd/moses-chart-cmd.xcodeproj/project.pbxproj | 53 | ||||
-rw-r--r-- | moses-chart-cmd/src/IOWrapper.cpp | 63 | ||||
-rw-r--r-- | moses-chart-cmd/src/IOWrapper.h | 18 | ||||
-rw-r--r-- | moses-chart-cmd/src/Main.cpp | 18 | ||||
-rw-r--r-- | moses-chart-cmd/src/Makefile.am | 4 | ||||
-rw-r--r-- | moses-chart-cmd/src/TranslationAnalysis.cpp | 2 | ||||
-rw-r--r-- | moses-chart-cmd/src/TranslationAnalysis.h | 2 |
9 files changed, 179 insertions, 326 deletions
diff --git a/moses-chart-cmd/moses-chart-cmd.vcproj b/moses-chart-cmd/moses-chart-cmd.vcproj deleted file mode 100644 index 3bbe3b4f5..000000000 --- a/moses-chart-cmd/moses-chart-cmd.vcproj +++ /dev/null @@ -1,228 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="moses-chart-cmd"
- ProjectGUID="{C3AF5C05-D4EC-41D2-8319-D1E69B9B5820}"
- RootNamespace="moseschartcmd"
- Keyword="Win32Proj"
- TargetFrameworkVersion="131072"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories=""../moses/src""
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;LM_INTERNAL;TRACE_ENABLE"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="zlib.lib "$(OutDir)\moses.lib" "$(OutDir)\moses-chart.lib" "$(OutDir)\OnDiskPt.lib""
- LinkIncremental="2"
- GenerateDebugInformation="true"
- SubSystem="1"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories=""../moses/src""
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;LM_INTERNAL;TRACE_ENABLE"
- RuntimeLibrary="2"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="zlib.lib "$(OutDir)\moses.lib" "$(OutDir)\moses-chart.lib" "$(OutDir)\OnDiskPt.lib""
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath=".\src\IOWrapper.cpp"
- >
- </File>
- <File
- RelativePath=".\src\Main.cpp"
- >
- </File>
- <File
- RelativePath=".\src\mbr.cpp"
- >
- </File>
- <File
- RelativePath=".\src\TranslationAnalysis.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath=".\src\IOWrapper.h"
- >
- </File>
- <File
- RelativePath=".\src\Main.h"
- >
- </File>
- <File
- RelativePath=".\src\mbr.h"
- >
- </File>
- <File
- RelativePath=".\src\TranslationAnalysis.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/moses-chart-cmd/moses-chart-cmd.vcxproj b/moses-chart-cmd/moses-chart-cmd.vcxproj new file mode 100644 index 000000000..585811288 --- /dev/null +++ b/moses-chart-cmd/moses-chart-cmd.vcxproj @@ -0,0 +1,117 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{C3AF5C05-D4EC-41D2-8319-D1E69B9B5820}</ProjectGuid>
+ <RootNamespace>moseschartcmd</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../moses/src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;LM_INTERNAL;TRACE_ENABLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>zlib.lib;$(OutDir)moses.lib;$(OutDir)OnDiskPt.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../moses/src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;LM_INTERNAL;TRACE_ENABLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Link>
+ <AdditionalDependencies>zlib.lib;$(OutDir)moses.lib;$(OutDir)OnDiskPt.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ <DataExecutionPrevention>
+ </DataExecutionPrevention>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="src\IOWrapper.cpp" />
+ <ClCompile Include="src\Main.cpp" />
+ <ClCompile Include="src\mbr.cpp" />
+ <ClCompile Include="src\TranslationAnalysis.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="src\IOWrapper.h" />
+ <ClInclude Include="src\Main.h" />
+ <ClInclude Include="src\mbr.h" />
+ <ClInclude Include="src\TranslationAnalysis.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\moses\moses.vcxproj">
+ <Project>{8122157a-0de5-44ff-8e5b-024ed6ace7af}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\OnDiskPt\OnDiskPt.vcxproj">
+ <Project>{8b07671b-cbaf-4514-affd-ce238cd427e9}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/moses-chart-cmd/moses-chart-cmd.xcodeproj/project.pbxproj b/moses-chart-cmd/moses-chart-cmd.xcodeproj/project.pbxproj index 31551fc24..c9da6b792 100644 --- a/moses-chart-cmd/moses-chart-cmd.xcodeproj/project.pbxproj +++ b/moses-chart-cmd/moses-chart-cmd.xcodeproj/project.pbxproj @@ -12,7 +12,6 @@ 1E9DA31611BDC84A00F4DBD1 /* Main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E9DA30C11BDC84A00F4DBD1 /* Main.cpp */; }; 1E9DA31811BDC84A00F4DBD1 /* mbr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E9DA31111BDC84A00F4DBD1 /* mbr.cpp */; }; 1E9DA31911BDC84A00F4DBD1 /* TranslationAnalysis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1E9DA31311BDC84A00F4DBD1 /* TranslationAnalysis.cpp */; }; - 1E9DA34211BDC8DB00F4DBD1 /* libmoses-chart.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E9DA34111BDC8CA00F4DBD1 /* libmoses-chart.a */; }; 1E9DA35011BDC97100F4DBD1 /* libOnDiskPt.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E9DA34F11BDC96A00F4DBD1 /* libOnDiskPt.a */; }; 1ED8B842124B98A60030CCF4 /* libkenlm.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E60D2A212496B1900D15873 /* libkenlm.a */; }; /* End PBXBuildFile section */ @@ -46,13 +45,6 @@ remoteGlobalIDString = D2AAC045055464E500DB518D; remoteInfo = moses; }; - 1E9DA34011BDC8CA00F4DBD1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1E9DA33911BDC8CA00F4DBD1 /* moses-chart.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D2AAC046055464E500DB518D; - remoteInfo = "moses-chart"; - }; 1E9DA34E11BDC96A00F4DBD1 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 1E9DA34A11BDC96A00F4DBD1 /* OnDiskPt.xcodeproj */; @@ -67,13 +59,6 @@ remoteGlobalIDString = D2AAC045055464E500DB518D; remoteInfo = OnDiskPt; }; - 1E9DA36711BDC9B200F4DBD1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1E9DA33911BDC8CA00F4DBD1 /* moses-chart.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = D2AAC045055464E500DB518D; - remoteInfo = "moses-chart"; - }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -99,7 +84,6 @@ 1E9DA31311BDC84A00F4DBD1 /* TranslationAnalysis.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TranslationAnalysis.cpp; path = src/TranslationAnalysis.cpp; sourceTree = "<group>"; }; 1E9DA31411BDC84A00F4DBD1 /* TranslationAnalysis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TranslationAnalysis.h; path = src/TranslationAnalysis.h; sourceTree = "<group>"; }; 1E9DA33311BDC8BB00F4DBD1 /* moses.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = moses.xcodeproj; path = ../moses/moses.xcodeproj; sourceTree = SOURCE_ROOT; }; - 1E9DA33911BDC8CA00F4DBD1 /* moses-chart.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "moses-chart.xcodeproj"; path = "../moses-chart/moses-chart.xcodeproj"; sourceTree = SOURCE_ROOT; }; 1E9DA34A11BDC96A00F4DBD1 /* OnDiskPt.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = OnDiskPt.xcodeproj; path = ../OnDiskPt/OnDiskPt.xcodeproj; sourceTree = SOURCE_ROOT; }; 8DD76F6C0486A84900D96B5E /* moses-chart-cmd */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "moses-chart-cmd"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -112,7 +96,6 @@ 1ED8B842124B98A60030CCF4 /* libkenlm.a in Frameworks */, 1E87F09311BDCD2E0033951C /* libmoses.a in Frameworks */, 1E9DA35011BDC97100F4DBD1 /* libOnDiskPt.a in Frameworks */, - 1E9DA34211BDC8DB00F4DBD1 /* libmoses-chart.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -124,7 +107,6 @@ children = ( 1E60D29A12496B1900D15873 /* kenlm.xcodeproj */, 1E9DA34A11BDC96A00F4DBD1 /* OnDiskPt.xcodeproj */, - 1E9DA33911BDC8CA00F4DBD1 /* moses-chart.xcodeproj */, 1E9DA33311BDC8BB00F4DBD1 /* moses.xcodeproj */, 08FB7795FE84155DC02AAC07 /* Source */, C6859E8C029090F304C91782 /* Documentation */, @@ -172,14 +154,6 @@ name = Products; sourceTree = "<group>"; }; - 1E9DA33A11BDC8CA00F4DBD1 /* Products */ = { - isa = PBXGroup; - children = ( - 1E9DA34111BDC8CA00F4DBD1 /* libmoses-chart.a */, - ); - name = Products; - sourceTree = "<group>"; - }; 1E9DA34B11BDC96A00F4DBD1 /* Products */ = { isa = PBXGroup; children = ( @@ -210,7 +184,6 @@ ); dependencies = ( 1E9DA36411BDC9B200F4DBD1 /* PBXTargetDependency */, - 1E9DA36811BDC9B200F4DBD1 /* PBXTargetDependency */, 1E87F09511BDCD390033951C /* PBXTargetDependency */, 1E60D2A912496B4F00D15873 /* PBXTargetDependency */, ); @@ -243,10 +216,6 @@ ProjectRef = 1E60D29A12496B1900D15873 /* kenlm.xcodeproj */; }, { - ProductGroup = 1E9DA33A11BDC8CA00F4DBD1 /* Products */; - ProjectRef = 1E9DA33911BDC8CA00F4DBD1 /* moses-chart.xcodeproj */; - }, - { ProductGroup = 1E9DA33411BDC8BB00F4DBD1 /* Products */; ProjectRef = 1E9DA33311BDC8BB00F4DBD1 /* moses.xcodeproj */; }, @@ -277,13 +246,6 @@ remoteRef = 1E87F08C11BDCD1B0033951C /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 1E9DA34111BDC8CA00F4DBD1 /* libmoses-chart.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = "libmoses-chart.a"; - remoteRef = 1E9DA34011BDC8CA00F4DBD1 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; 1E9DA34F11BDC96A00F4DBD1 /* libOnDiskPt.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -323,11 +285,6 @@ name = OnDiskPt; targetProxy = 1E9DA36311BDC9B200F4DBD1 /* PBXContainerItemProxy */; }; - 1E9DA36811BDC9B200F4DBD1 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "moses-chart"; - targetProxy = 1E9DA36711BDC9B200F4DBD1 /* PBXContainerItemProxy */; - }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -399,7 +356,10 @@ GCC_PREPROCESSOR_DEFINITIONS = TRACE_ENABLE; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ../moses/src; + HEADER_SEARCH_PATHS = ( + ../moses/src, + ../, + ); ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; SDKROOT = macosx10.6; @@ -414,7 +374,10 @@ GCC_PREPROCESSOR_DEFINITIONS = TRACE_ENABLE; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ../moses/src; + HEADER_SEARCH_PATHS = ( + ../moses/src, + ../, + ); ONLY_ACTIVE_ARCH = YES; PREBINDING = NO; SDKROOT = macosx10.6; diff --git a/moses-chart-cmd/src/IOWrapper.cpp b/moses-chart-cmd/src/IOWrapper.cpp index 260a16248..ed6112e00 100644 --- a/moses-chart-cmd/src/IOWrapper.cpp +++ b/moses-chart-cmd/src/IOWrapper.cpp @@ -41,12 +41,15 @@ POSSIBILITY OF SUCH DAMAGE. #include "DummyScoreProducers.h" #include "InputFileStream.h" #include "PhraseDictionary.h" -#include "../../moses-chart/src/ChartTrellisPathList.h" -#include "../../moses-chart/src/ChartTrellisPath.h" +#include "ChartTrellisPathList.h" +#include "ChartTrellisPath.h" +#include "ChartTranslationOption.h" +#include "ChartHypothesis.h" +#include "DotChart.h" + using namespace std; using namespace Moses; -using namespace MosesChart; IOWrapper::IOWrapper(const std::vector<FactorType> &inputFactorOrder , const std::vector<FactorType> &outputFactorOrder @@ -165,37 +168,37 @@ void OutputSurface(std::ostream &out, const Phrase &phrase, const std::vector<Fa } } -void OutputSurface(std::ostream &out, const MosesChart::Hypothesis *hypo, const std::vector<FactorType> &outputFactorOrder +void OutputSurface(std::ostream &out, const ChartHypothesis *hypo, const std::vector<FactorType> &outputFactorOrder ,bool reportSegmentation, bool reportAllFactors) { if ( hypo != NULL) { //OutputSurface(out, hypo->GetCurrTargetPhrase(), outputFactorOrder, reportAllFactors); - const vector<const MosesChart::Hypothesis*> &prevHypos = hypo->GetPrevHypos(); + const vector<const ChartHypothesis*> &prevHypos = hypo->GetPrevHypos(); - vector<const MosesChart::Hypothesis*>::const_iterator iter; + vector<const ChartHypothesis*>::const_iterator iter; for (iter = prevHypos.begin(); iter != prevHypos.end(); ++iter) { - const MosesChart::Hypothesis *prevHypo = *iter; + const ChartHypothesis *prevHypo = *iter; OutputSurface(out, prevHypo, outputFactorOrder, reportSegmentation, reportAllFactors); } } } -void IOWrapper::Backtrack(const MosesChart::Hypothesis *hypo) +void IOWrapper::Backtrack(const ChartHypothesis *hypo) { - const vector<const MosesChart::Hypothesis*> &prevHypos = hypo->GetPrevHypos(); + const vector<const ChartHypothesis*> &prevHypos = hypo->GetPrevHypos(); - vector<const MosesChart::Hypothesis*>::const_iterator iter; + vector<const ChartHypothesis*>::const_iterator iter; for (iter = prevHypos.begin(); iter != prevHypos.end(); ++iter) { - const MosesChart::Hypothesis *prevHypo = *iter; + const ChartHypothesis *prevHypo = *iter; VERBOSE(3,prevHypo->GetId() << " <= "); Backtrack(prevHypo); } } -void IOWrapper::OutputBestHypo(const std::vector<const Factor*>& mbrBestHypo, long /*translationId*/, bool reportSegmentation, bool reportAllFactors) +void IOWrapper::OutputBestHypo(const std::vector<const Factor*>& mbrBestHypo, long /*translationId*/, bool /* reportSegmentation */, bool /* reportAllFactors */) { for (size_t i = 0 ; i < mbrBestHypo.size() ; i++) { const Factor *factor = mbrBestHypo[i]; @@ -203,7 +206,7 @@ void IOWrapper::OutputBestHypo(const std::vector<const Factor*>& mbrBestHypo, l } } /* -void OutputInput(std::vector<const Phrase*>& map, const MosesChart::Hypothesis* hypo) +void OutputInput(std::vector<const Phrase*>& map, const ChartHypothesis* hypo) { if (hypo->GetPrevHypos()) { @@ -212,7 +215,7 @@ void OutputInput(std::vector<const Phrase*>& map, const MosesChart::Hypothesis* } } -void OutputInput(std::ostream& os, const MosesChart::Hypothesis* hypo) +void OutputInput(std::ostream& os, const ChartHypothesis* hypo) { size_t len = StaticData::Instance().GetInput()->GetSize(); std::vector<const Phrase*> inp_phrases(len, 0); @@ -222,25 +225,29 @@ void OutputInput(std::ostream& os, const MosesChart::Hypothesis* hypo) } */ -void OutputTranslationOptions(std::ostream &out, const MosesChart::Hypothesis *hypo, long translationId) +void OutputTranslationOptions(std::ostream &out, const ChartHypothesis *hypo, long translationId) { // recursive if (hypo != NULL) { - out << "Trans Opt " << translationId << " " << hypo->GetCurrSourceRange() << ": " << hypo->GetTranslationOption() + out << "Trans Opt " << translationId + << " " << hypo->GetCurrSourceRange() + << ": " << hypo->GetTranslationOption().GetDottedRule() + << ": " << hypo->GetCurrTargetPhrase().GetTargetLHS() + << "->" << hypo->GetCurrTargetPhrase() << " " << hypo->GetTotalScore() << hypo->GetScoreBreakdown() << endl; } - const std::vector<const MosesChart::Hypothesis*> &prevHypos = hypo->GetPrevHypos(); - std::vector<const MosesChart::Hypothesis*>::const_iterator iter; + const std::vector<const ChartHypothesis*> &prevHypos = hypo->GetPrevHypos(); + std::vector<const ChartHypothesis*>::const_iterator iter; for (iter = prevHypos.begin(); iter != prevHypos.end(); ++iter) { - const MosesChart::Hypothesis *prevHypo = *iter; + const ChartHypothesis *prevHypo = *iter; OutputTranslationOptions(out, prevHypo, translationId); } } void IOWrapper::OutputDetailedTranslationReport( - const MosesChart::Hypothesis *hypo, + const ChartHypothesis *hypo, long translationId) { if (hypo == NULL) { @@ -252,7 +259,7 @@ void IOWrapper::OutputDetailedTranslationReport( m_detailOutputCollector->Write(translationId, out.str()); } -void IOWrapper::OutputBestHypo(const MosesChart::Hypothesis *hypo, long translationId, bool reportSegmentation, bool reportAllFactors) +void IOWrapper::OutputBestHypo(const ChartHypothesis *hypo, long translationId, bool /* reportSegmentation */, bool /* reportAllFactors */) { std::ostringstream out; IOWrapper::FixPrecision(out); @@ -264,14 +271,14 @@ void IOWrapper::OutputBestHypo(const MosesChart::Hypothesis *hypo, long translat if (StaticData::Instance().GetOutputHypoScore()) { out << hypo->GetTotalScore() << " " - << MosesChart::Hypothesis::GetHypoCount() << " "; + << ChartHypothesis::GetHypoCount() << " "; } if (!m_surpressSingleBestOutput) { if (StaticData::Instance().IsPathRecoveryEnabled()) { out << "||| "; } - Phrase outPhrase(Output); + Phrase outPhrase(Output, ARRAY_SIZE_INCR); hypo->CreateOutputPhrase(outPhrase); // delete 1st & last @@ -298,7 +305,7 @@ void IOWrapper::OutputBestHypo(const MosesChart::Hypothesis *hypo, long translat } } -void IOWrapper::OutputNBestList(const MosesChart::TrellisPathList &nBestList, const MosesChart::Hypothesis *bestHypo, const TranslationSystem* system, long translationId) +void IOWrapper::OutputNBestList(const ChartTrellisPathList &nBestList, const ChartHypothesis *bestHypo, const TranslationSystem* system, long translationId) { std::ostringstream out; @@ -312,7 +319,7 @@ void IOWrapper::OutputNBestList(const MosesChart::TrellisPathList &nBestList, co if (StaticData::Instance().GetOutputHypoScore()) { if (bestHypo != NULL) { out << bestHypo->GetTotalScore() << " " - << MosesChart::Hypothesis::GetHypoCount() << " "; + << ChartHypothesis::GetHypoCount() << " "; } else { out << "0 "; } @@ -322,9 +329,9 @@ void IOWrapper::OutputNBestList(const MosesChart::TrellisPathList &nBestList, co bool labeledOutput = StaticData::Instance().IsLabeledNBestList(); //bool includeAlignment = StaticData::Instance().NBestIncludesAlignment(); - MosesChart::TrellisPathList::const_iterator iter; + ChartTrellisPathList::const_iterator iter; for (iter = nBestList.begin() ; iter != nBestList.end() ; ++iter) { - const MosesChart::TrellisPath &path = **iter; + const ChartTrellisPath &path = **iter; //cerr << path << endl << endl; Moses::Phrase outputPhrase = path.GetOutputPhrase(); @@ -433,7 +440,7 @@ void IOWrapper::OutputNBestList(const MosesChart::TrellisPathList &nBestList, co *m_nBestStream << " |||"; for (int currEdge = (int)edges.size() - 2 ; currEdge >= 0 ; currEdge--) { - const MosesChart::Hypothesis &edge = *edges[currEdge]; + const ChartHypothesis &edge = *edges[currEdge]; WordsRange sourceRange = edge.GetCurrSourceWordsRange(); WordsRange targetRange = edge.GetCurrTargetWordsRange(); *m_nBestStream << " " << sourceRange.GetStartPos(); diff --git a/moses-chart-cmd/src/IOWrapper.h b/moses-chart-cmd/src/IOWrapper.h index fca183436..c606774e1 100644 --- a/moses-chart-cmd/src/IOWrapper.h +++ b/moses-chart-cmd/src/IOWrapper.h @@ -40,18 +40,14 @@ POSSIBILITY OF SUCH DAMAGE. #include "Sentence.h" #include "FactorTypeSet.h" #include "TranslationSystem.h" -#include "TrellisPathList.h" +#include "ChartTrellisPathList.h" #include "OutputCollector.h" -#include "../../moses-chart/src/ChartHypothesis.h" +#include "ChartHypothesis.h" namespace Moses { class FactorCollection; -} - -namespace MosesChart -{ -class TrellisPathList; +class ChartTrellisPathList; } class IOWrapper @@ -83,11 +79,11 @@ public: ~IOWrapper(); Moses::InputType* GetInput(Moses::InputType *inputType); - void OutputBestHypo(const MosesChart::Hypothesis *hypo, long translationId, bool reportSegmentation, bool reportAllFactors); + void OutputBestHypo(const Moses::ChartHypothesis *hypo, long translationId, bool reportSegmentation, bool reportAllFactors); void OutputBestHypo(const std::vector<const Moses::Factor*>& mbrBestHypo, long translationId, bool reportSegmentation, bool reportAllFactors); - void OutputNBestList(const MosesChart::TrellisPathList &nBestList, const MosesChart::Hypothesis *bestHypo, const Moses::TranslationSystem* system, long translationId); - void OutputDetailedTranslationReport(const MosesChart::Hypothesis *hypo, long translationId); - void Backtrack(const MosesChart::Hypothesis *hypo); + void OutputNBestList(const Moses::ChartTrellisPathList &nBestList, const Moses::ChartHypothesis *bestHypo, const Moses::TranslationSystem* system, long translationId); + void OutputDetailedTranslationReport(const Moses::ChartHypothesis *hypo, long translationId); + void Backtrack(const Moses::ChartHypothesis *hypo); void ResetTranslationId() { m_translationId = 0; diff --git a/moses-chart-cmd/src/Main.cpp b/moses-chart-cmd/src/Main.cpp index 10eff5acd..87174b438 100644 --- a/moses-chart-cmd/src/Main.cpp +++ b/moses-chart-cmd/src/Main.cpp @@ -34,17 +34,15 @@ POSSIBILITY OF SUCH DAMAGE. #ifdef WIN32 // Include Visual Leak Detector -#include <vld.h> +//#include <vld.h> #endif #include <fstream> #include "Main.h" -#include "TrellisPath.h" #include "FactorCollection.h" #include "Manager.h" #include "Phrase.h" #include "Util.h" -#include "TrellisPathList.h" #include "Timer.h" #include "IOWrapper.h" #include "Sentence.h" @@ -54,9 +52,10 @@ POSSIBILITY OF SUCH DAMAGE. #include "TranslationAnalysis.h" #include "mbr.h" #include "ThreadPool.h" -#include "../../moses-chart/src/ChartManager.h" -#include "../../moses-chart/src/ChartHypothesis.h" -#include "../../moses-chart/src/ChartTrellisPathList.h" +#include "ChartManager.h" +#include "ChartHypothesis.h" +#include "ChartTrellisPath.h" +#include "ChartTrellisPathList.h" #if HAVE_CONFIG_H #include "config.h" @@ -67,7 +66,6 @@ POSSIBILITY OF SUCH DAMAGE. using namespace std; using namespace Moses; -using namespace MosesChart; /** * Translates a sentence. @@ -91,13 +89,13 @@ public: VERBOSE(2,"\nTRANSLATING(" << lineNumber << "): " << *m_source); - MosesChart::Manager manager(*m_source, &system); + ChartManager manager(*m_source, &system); manager.ProcessSentence(); assert(!staticData.UseMBR()); // 1-best - const MosesChart::Hypothesis *bestHypo = manager.GetBestHypothesis(); + const ChartHypothesis *bestHypo = manager.GetBestHypothesis(); m_ioWrapper.OutputBestHypo(bestHypo, lineNumber, staticData.GetReportSegmentation(), staticData.GetReportAllFactors()); @@ -113,7 +111,7 @@ public: size_t nBestSize = staticData.GetNBestSize(); if (nBestSize > 0) { VERBOSE(2,"WRITING " << nBestSize << " TRANSLATION ALTERNATIVES TO " << staticData.GetNBestFilePath() << endl); - MosesChart::TrellisPathList nBestList; + ChartTrellisPathList nBestList; manager.CalcNBest(nBestSize, nBestList,staticData.GetDistinctNBest()); m_ioWrapper.OutputNBestList(nBestList, bestHypo, &system, lineNumber); IFVERBOSE(2) { diff --git a/moses-chart-cmd/src/Makefile.am b/moses-chart-cmd/src/Makefile.am index bab006ca7..b6e7cc4ff 100644 --- a/moses-chart-cmd/src/Makefile.am +++ b/moses-chart-cmd/src/Makefile.am @@ -2,8 +2,8 @@ bin_PROGRAMS = moses_chart moses_chart_SOURCES = Main.cpp mbr.cpp IOWrapper.cpp TranslationAnalysis.cpp AM_CPPFLAGS = -W -Wall -ffor-scope -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DUSE_HYPO_POOL -I$(top_srcdir)/moses/src $(BOOST_CPPFLAGS) -moses_chart_LDADD = -L$(top_srcdir)/moses/src -L$(top_srcdir)/moses-chart/src -L$(top_srcdir)/OnDiskPt/src -lmoses -lmoses-chart -lOnDiskPt @KENLM_LDFLAGS@ $(BOOST_THREAD_LDFLAGS) $(BOOST_THREAD_LIBS) -moses_chart_DEPENDENCIES = $(top_srcdir)/moses/src/libmoses.la $(top_srcdir)/moses-chart/src/libmoses-chart.a $(top_srcdir)/OnDiskPt/src/libOnDiskPt.a @KENLM_DEPS@ +moses_chart_LDADD = -L$(top_srcdir)/moses/src -L$(top_srcdir)/OnDiskPt/src -lmoses -lOnDiskPt @KENLM_LDFLAGS@ $(BOOST_THREAD_LDFLAGS) $(BOOST_THREAD_LIBS) +moses_chart_DEPENDENCIES = $(top_srcdir)/moses/src/libmoses.la $(top_srcdir)/OnDiskPt/src/libOnDiskPt.a @KENLM_DEPS@ diff --git a/moses-chart-cmd/src/TranslationAnalysis.cpp b/moses-chart-cmd/src/TranslationAnalysis.cpp index 939954fc8..1ba6052ed 100644 --- a/moses-chart-cmd/src/TranslationAnalysis.cpp +++ b/moses-chart-cmd/src/TranslationAnalysis.cpp @@ -14,7 +14,7 @@ using namespace Moses; namespace TranslationAnalysis { -void PrintTranslationAnalysis(ostream &os, const Hypothesis* hypo) +void PrintTranslationAnalysis(ostream & /* os */, const Hypothesis* /* hypo */) { /* os << endl << "TRANSLATION HYPOTHESIS DETAILS:" << endl; diff --git a/moses-chart-cmd/src/TranslationAnalysis.h b/moses-chart-cmd/src/TranslationAnalysis.h index 426158a42..1291548f8 100644 --- a/moses-chart-cmd/src/TranslationAnalysis.h +++ b/moses-chart-cmd/src/TranslationAnalysis.h @@ -8,7 +8,7 @@ #define _TRANSLATION_ANALYSIS_H_ #include <iostream> -#include "Hypothesis.h" +#include "ChartHypothesis.h" namespace TranslationAnalysis { |