From 4649248a3fa82c89c3d3782cecdcdcf5d487771b Mon Sep 17 00:00:00 2001 From: "Wu, Ke" Date: Fri, 10 Oct 2014 16:55:48 -0400 Subject: Remove using namespace std --- utils/alignment.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'utils/alignment.h') diff --git a/utils/alignment.h b/utils/alignment.h index c0648aab..456577ca 100644 --- a/utils/alignment.h +++ b/utils/alignment.h @@ -15,8 +15,6 @@ #include "stringlib.h" -using namespace std; - /* * Note: * m_vec_s_align.size() may not be equal to the length of source side @@ -25,12 +23,12 @@ using namespace std; * */ struct SAlignment { - typedef vector SingleAlign; + typedef std::vector SingleAlign; SAlignment(const char* pszAlign) { fnInitializeAlignment(pszAlign); } ~SAlignment() {} bool fnIsAligned(int i, bool s) const { - const vector* palign; + const std::vector* palign; if (s == true) palign = &m_vec_s_align; else @@ -70,7 +68,7 @@ struct SAlignment { } bool fnIsAlignedTightPhrase(int b, int e, bool s, int* pob, int* poe) const { - const vector* palign; + const std::vector* palign; if (s == true) palign = &m_vec_s_align; else @@ -97,7 +95,7 @@ struct SAlignment { * aligned to any word outside source[b, e] * 3) return "Discon't": otherwise; */ - string fnIsContinuous(int b, int e) const { + std::string fnIsContinuous(int b, int e) const { int ob, oe; fnGetLeftRightMost(b, e, true, ob, oe); if (ob == -1) return "Unaligned"; @@ -124,7 +122,7 @@ struct SAlignment { } private: - void fnGetLeftRightMost(int b, int e, const vector& align, + void fnGetLeftRightMost(int b, int e, const std::vector& align, int& ob, int& oe) const { ob = oe = -1; for (int i = b; i <= e && i < align.size(); i++) { @@ -139,7 +137,7 @@ struct SAlignment { m_vec_s_align.clear(); m_vec_t_align.clear(); - vector terms = SplitOnWhitespace(string(pszAlign)); + std::vector terms = SplitOnWhitespace(std::string(pszAlign)); int si, ti; for (size_t i = 0; i < terms.size(); i++) { sscanf(terms[i].c_str(), "%d-%d", &si, &ti); @@ -167,8 +165,8 @@ struct SAlignment { } private: - vector m_vec_s_align; // source side words' alignment - vector m_vec_t_align; // target side words' alignment + std::vector m_vec_s_align; // source side words' alignment + std::vector m_vec_t_align; // target side words' alignment }; struct SAlignmentReader { -- cgit v1.2.3