mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-01 08:21:47 +03:00
Use const instead of #define macros if possible.
This commit is contained in:
parent
245be8f63d
commit
0ea2bc6fac
@ -3,6 +3,12 @@
|
||||
#include <stdlib.h>
|
||||
#include <cstring>
|
||||
|
||||
namespace {
|
||||
|
||||
const int LINE_MAX_LENGTH = 10000;
|
||||
|
||||
} // namespace
|
||||
|
||||
using namespace std;
|
||||
|
||||
void Alignment::Create( string fileName )
|
||||
|
@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#define LINE_MAX_LENGTH 10000
|
||||
#include "Vocabulary.h"
|
||||
|
||||
class Alignment
|
||||
|
@ -3,6 +3,12 @@
|
||||
#include <stdlib.h>
|
||||
#include <cstring>
|
||||
|
||||
namespace {
|
||||
|
||||
const int LINE_MAX_LENGTH = 10000;
|
||||
|
||||
} // namespace
|
||||
|
||||
using namespace std;
|
||||
|
||||
void SuffixArray::Create( string fileName )
|
||||
|
@ -1,7 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#define LINE_MAX_LENGTH 10000
|
||||
|
||||
#include "Vocabulary.h"
|
||||
|
||||
class SuffixArray
|
||||
|
@ -1,8 +1,17 @@
|
||||
#include "TargetCorpus.h"
|
||||
|
||||
#include <string>
|
||||
#include <stdlib.h>
|
||||
#include <cstring>
|
||||
|
||||
namespace {
|
||||
|
||||
const int LINE_MAX_LENGTH = 10000;
|
||||
|
||||
} // namespace
|
||||
|
||||
using namespace std;
|
||||
|
||||
void TargetCorpus::Create( string fileName )
|
||||
{
|
||||
ifstream textFile;
|
||||
|
@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#define LINE_MAX_LENGTH 10000
|
||||
#include "Vocabulary.h"
|
||||
|
||||
class TargetCorpus
|
||||
|
@ -1,6 +1,14 @@
|
||||
// $Id: Vocabulary.cpp 1565 2008-02-22 14:42:01Z bojar $
|
||||
#include "Vocabulary.h"
|
||||
|
||||
namespace {
|
||||
|
||||
const int MAX_LENGTH = 10000;
|
||||
|
||||
} // namespace
|
||||
|
||||
using namespace std;
|
||||
|
||||
// as in beamdecoder/tables.cpp
|
||||
vector<WORD_ID> Vocabulary::Tokenize( const char input[] )
|
||||
{
|
||||
|
@ -10,11 +10,10 @@
|
||||
#include <queue>
|
||||
#include <map>
|
||||
#include <cmath>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
#define MAX_LENGTH 10000
|
||||
|
||||
#define SAFE_GETLINE(_IS, _LINE, _SIZE, _DELIM) { \
|
||||
_IS.getline(_LINE, _SIZE, _DELIM); \
|
||||
if(_IS.fail() && !_IS.bad() && !_IS.eof()) _IS.clear(); \
|
||||
|
@ -118,4 +118,6 @@ int main(int argc, char* argv[])
|
||||
ppCollection.GetCollection( queryString );
|
||||
ppCollection.PrintHTML();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user