2012-05-09 21:21:41 +04:00
|
|
|
#ifndef MERT_PREPROCESSFILTER_H_
|
|
|
|
#define MERT_PREPROCESSFILTER_H_
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2012-06-30 23:23:45 +04:00
|
|
|
namespace MosesTuning
|
|
|
|
{
|
|
|
|
|
|
|
|
|
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:
|
|
|
|
ofdstream* m_toFilter;
|
2012-05-10 01:57:44 +04:00
|
|
|
ifdstream* m_fromFilter;
|
2012-05-09 21:21:41 +04:00
|
|
|
};
|
|
|
|
|
2012-06-30 23:23:45 +04:00
|
|
|
}
|
|
|
|
|
2012-05-09 21:21:41 +04:00
|
|
|
#endif // MERT_PREPROCESSFILTER_H_
|