2013-11-14 22:59:36 +04:00
|
|
|
#pragma once
|
|
|
|
|
2012-05-09 21:21:41 +04:00
|
|
|
#include <string>
|
|
|
|
|
2013-11-14 23:15:53 +04:00
|
|
|
#if defined(__GLIBCXX__) || defined(__GLIBCPP__)
|
|
|
|
|
2012-06-30 23:23:45 +04:00
|
|
|
namespace MosesTuning
|
|
|
|
{
|
2013-05-29 21:16:15 +04:00
|
|
|
|
2012-06-30 23:23:45 +04:00
|
|
|
|
2012-05-10 01:57:44 +04:00
|
|
|
class ofdstream;
|
|
|
|
class ifdstream;
|
2012-05-09 21:21:41 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This class runs the filter command in a child process and
|
|
|
|
* then use this filter to process given sentences.
|
|
|
|
*/
|
|
|
|
class PreProcessFilter
|
|
|
|
{
|
|
|
|
public:
|
2012-05-10 01:57:44 +04:00
|
|
|
explicit PreProcessFilter(const std::string& filterCommand);
|
|
|
|
std::string ProcessSentence(const std::string& sentence);
|
|
|
|
~PreProcessFilter();
|
2012-05-09 21:21:41 +04:00
|
|
|
|
|
|
|
private:
|
2013-05-29 21:16:15 +04:00
|
|
|
ofdstream* m_toFilter;
|
|
|
|
ifdstream* m_fromFilter;
|
2012-05-09 21:21:41 +04:00
|
|
|
};
|
|
|
|
|
2012-06-30 23:23:45 +04:00
|
|
|
}
|
|
|
|
|
2013-11-14 22:59:36 +04:00
|
|
|
#endif
|