00001 // -*- mode: c++; indent-tabs-mode: nil; tab-width: 2 -*- 00002 #pragma once 00003 // $Id$ 00004 00005 /*********************************************************************** 00006 Moses - factored phrase-based language decoder 00007 Copyright (c) 2006 University of Edinburgh 00008 All rights reserved. 00009 00010 Redistribution and use in source and binary forms, with or without modification, 00011 are permitted provided that the following conditions are met: 00012 00013 * Redistributions of source code must retain the above copyright notice, 00014 this list of conditions and the following disclaimer. 00015 * Redistributions in binary form must reproduce the above copyright notice, 00016 this list of conditions and the following disclaimer in the documentation 00017 and/or other materials provided with the distribution. 00018 * Neither the name of the University of Edinburgh nor the names of its contributors 00019 may be used to endorse or promote products derived from this software 00020 without specific prior written permission. 00021 00022 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00023 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00024 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00025 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 00026 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00027 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00028 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00029 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 00030 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00031 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00032 POSSIBILITY OF SUCH DAMAGE. 00033 ***********************************************************************/ 00034 00035 // example file on how to use moses library 00036 00037 #include "StaticData.h" 00038 #include "IOWrapper.h" 00039 #include "TypeDef.h" 00040 00041 class SimpleTranslationInterface 00042 { 00043 public: 00044 static void DestroyFeatureFunctionStatic(); 00045 SimpleTranslationInterface(const std::string &mosesIni); 00046 ~SimpleTranslationInterface(); 00047 std::string translate(const std::string &input); 00048 Moses::StaticData& getStaticData(); 00049 Moses::Parameter& getParameters() { 00050 return m_params; 00051 } 00052 private: 00053 SimpleTranslationInterface(); 00054 Moses::Parameter m_params; 00055 const Moses::StaticData& m_staticData; 00056 }; 00057 00058 int decoder_main(int argc, char const* argv[]); 00059