diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2015-10-25 16:37:59 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2015-10-25 16:37:59 +0300 |
commit | 97b2aa5663e97079145fb494bf97e1b2997b4161 (patch) | |
tree | f8a68fa4ea40bb99c21cd26e7f02a27ddcc48187 /moses/Syntax | |
parent | 84b1c4b4c0c02362cdb35b55e08196d03b993baf (diff) |
WordsRange -> Range
Diffstat (limited to 'moses/Syntax')
-rw-r--r-- | moses/Syntax/F2S/DerivationWriter.cpp | 2 | ||||
-rw-r--r-- | moses/Syntax/F2S/HyperTreeLoader.cpp | 2 | ||||
-rw-r--r-- | moses/Syntax/PVertex.h | 6 | ||||
-rw-r--r-- | moses/Syntax/S2T/DerivationWriter.cpp | 2 | ||||
-rw-r--r-- | moses/Syntax/S2T/Manager-inl.h | 4 | ||||
-rw-r--r-- | moses/Syntax/S2T/ParserCallback.h | 4 | ||||
-rw-r--r-- | moses/Syntax/S2T/Parsers/Parser.h | 2 | ||||
-rw-r--r-- | moses/Syntax/S2T/Parsers/RecursiveCYKPlusParser/RecursiveCYKPlusParser-inl.h | 2 | ||||
-rw-r--r-- | moses/Syntax/S2T/Parsers/RecursiveCYKPlusParser/RecursiveCYKPlusParser.h | 4 | ||||
-rw-r--r-- | moses/Syntax/S2T/Parsers/Scope3Parser/Parser-inl.h | 2 | ||||
-rw-r--r-- | moses/Syntax/S2T/Parsers/Scope3Parser/Parser.h | 4 | ||||
-rw-r--r-- | moses/Syntax/S2T/RuleTrieLoader.cpp | 2 | ||||
-rw-r--r-- | moses/Syntax/T2S/InputTreeBuilder.cpp | 8 | ||||
-rw-r--r-- | moses/Syntax/T2S/RuleTrieLoader.cpp | 2 |
14 files changed, 23 insertions, 23 deletions
diff --git a/moses/Syntax/F2S/DerivationWriter.cpp b/moses/Syntax/F2S/DerivationWriter.cpp index efa3c3d47..390508a37 100644 --- a/moses/Syntax/F2S/DerivationWriter.cpp +++ b/moses/Syntax/F2S/DerivationWriter.cpp @@ -79,7 +79,7 @@ void DerivationWriter::WriteLine(const SHyperedge ­peredge, // Spans covered by source RHS symbols. for (std::size_t i = 0; i < shyperedge.tail.size(); ++i) { const SVertex *child = shyperedge.tail[i]; - const WordsRange &span = child->pvertex->span; + const Range &span = child->pvertex->span; out << " " << span.GetStartPos() << ".." << span.GetEndPos(); } diff --git a/moses/Syntax/F2S/HyperTreeLoader.cpp b/moses/Syntax/F2S/HyperTreeLoader.cpp index aefddbc2d..c23594c54 100644 --- a/moses/Syntax/F2S/HyperTreeLoader.cpp +++ b/moses/Syntax/F2S/HyperTreeLoader.cpp @@ -15,7 +15,7 @@ #include "moses/Util.h" #include "moses/InputFileStream.h" #include "moses/StaticData.h" -#include "moses/WordsRange.h" +#include "moses/Range.h" #include "moses/ChartTranslationOptionList.h" #include "moses/FactorCollection.h" #include "moses/Syntax/RuleTableFF.h" diff --git a/moses/Syntax/PVertex.h b/moses/Syntax/PVertex.h index 8832128b4..23cfbdb5f 100644 --- a/moses/Syntax/PVertex.h +++ b/moses/Syntax/PVertex.h @@ -1,7 +1,7 @@ #pragma once #include "moses/Word.h" -#include "moses/WordsRange.h" +#include "moses/Range.h" namespace Moses { @@ -10,9 +10,9 @@ namespace Syntax struct PVertex { public: - PVertex(const WordsRange &wr, const Word &w) : span(wr), symbol(w) {} + PVertex(const Range &wr, const Word &w) : span(wr), symbol(w) {} - WordsRange span; + Range span; Word symbol; }; diff --git a/moses/Syntax/S2T/DerivationWriter.cpp b/moses/Syntax/S2T/DerivationWriter.cpp index 33fb8d70b..159763a46 100644 --- a/moses/Syntax/S2T/DerivationWriter.cpp +++ b/moses/Syntax/S2T/DerivationWriter.cpp @@ -78,7 +78,7 @@ void DerivationWriter::WriteLine(const SHyperedge ­peredge, // Spans covered by source RHS symbols. for (std::size_t i = 0; i < shyperedge.tail.size(); ++i) { const SVertex *child = shyperedge.tail[i]; - const WordsRange &span = child->pvertex->span; + const Range &span = child->pvertex->span; out << " " << span.GetStartPos() << ".." << span.GetEndPos(); } diff --git a/moses/Syntax/S2T/Manager-inl.h b/moses/Syntax/S2T/Manager-inl.h index 422f14915..0dff7b846 100644 --- a/moses/Syntax/S2T/Manager-inl.h +++ b/moses/Syntax/S2T/Manager-inl.h @@ -45,7 +45,7 @@ void Manager<Parser>::InitializeCharts() const Word &terminal = m_source.GetWord(i); // PVertex - PVertex tmp(WordsRange(i,i), terminal); + PVertex tmp(Range(i,i), terminal); PVertex &pvertex = m_pchart.AddVertex(tmp); // SVertex @@ -184,7 +184,7 @@ void Manager<Parser>::Decode() //PChart::Cell &pcell = m_pchart.GetCell(start, end); SChart::Cell &scell = m_schart.GetCell(start, end); - WordsRange range(start, end); + Range range(start, end); // Call the parsers to generate PHyperedges for this span and convert // each one to a SHyperedgeBundle (via the callback). The callback diff --git a/moses/Syntax/S2T/ParserCallback.h b/moses/Syntax/S2T/ParserCallback.h index f9db51601..2314b27f3 100644 --- a/moses/Syntax/S2T/ParserCallback.h +++ b/moses/Syntax/S2T/ParserCallback.h @@ -31,7 +31,7 @@ public: m_container.SwapIn(m_tmpBundle, score); } - void InitForRange(const WordsRange &range) { + void InitForRange(const Range &range) { m_container.LazyClear(); } @@ -62,7 +62,7 @@ public: m_containers[end].SwapIn(m_tmpBundle, score); } - void InitForRange(const WordsRange &range) { + void InitForRange(const Range &range) { const std::size_t start = range.GetStartPos(); m_end = range.GetEndPos(); if (start != m_prevStart) { diff --git a/moses/Syntax/S2T/Parsers/Parser.h b/moses/Syntax/S2T/Parsers/Parser.h index 785fb66f9..c0f460a8f 100644 --- a/moses/Syntax/S2T/Parsers/Parser.h +++ b/moses/Syntax/S2T/Parsers/Parser.h @@ -20,7 +20,7 @@ public: virtual ~Parser() {} - virtual void EnumerateHyperedges(const WordsRange &, Callback &) = 0; + virtual void EnumerateHyperedges(const Range &, Callback &) = 0; protected: PChart &m_chart; }; diff --git a/moses/Syntax/S2T/Parsers/RecursiveCYKPlusParser/RecursiveCYKPlusParser-inl.h b/moses/Syntax/S2T/Parsers/RecursiveCYKPlusParser/RecursiveCYKPlusParser-inl.h index c8f57c4d1..c0201bded 100644 --- a/moses/Syntax/S2T/Parsers/RecursiveCYKPlusParser/RecursiveCYKPlusParser-inl.h +++ b/moses/Syntax/S2T/Parsers/RecursiveCYKPlusParser/RecursiveCYKPlusParser-inl.h @@ -24,7 +24,7 @@ RecursiveCYKPlusParser<Callback>::RecursiveCYKPlusParser( template<typename Callback> void RecursiveCYKPlusParser<Callback>::EnumerateHyperedges( - const WordsRange &range, + const Range &range, Callback &callback) { const std::size_t start = range.GetStartPos(); diff --git a/moses/Syntax/S2T/Parsers/RecursiveCYKPlusParser/RecursiveCYKPlusParser.h b/moses/Syntax/S2T/Parsers/RecursiveCYKPlusParser/RecursiveCYKPlusParser.h index 2b8edbfd1..ce5272f15 100644 --- a/moses/Syntax/S2T/Parsers/RecursiveCYKPlusParser/RecursiveCYKPlusParser.h +++ b/moses/Syntax/S2T/Parsers/RecursiveCYKPlusParser/RecursiveCYKPlusParser.h @@ -4,7 +4,7 @@ #include "moses/Syntax/PVertex.h" #include "moses/Syntax/S2T/Parsers/Parser.h" #include "moses/Syntax/S2T/RuleTrieCYKPlus.h" -#include "moses/WordsRange.h" +#include "moses/Range.h" namespace Moses { @@ -35,7 +35,7 @@ public: ~RecursiveCYKPlusParser() {} - void EnumerateHyperedges(const WordsRange &, Callback &); + void EnumerateHyperedges(const Range &, Callback &); private: diff --git a/moses/Syntax/S2T/Parsers/Scope3Parser/Parser-inl.h b/moses/Syntax/S2T/Parsers/Scope3Parser/Parser-inl.h index da81a5606..1225ec910 100644 --- a/moses/Syntax/S2T/Parsers/Scope3Parser/Parser-inl.h +++ b/moses/Syntax/S2T/Parsers/Scope3Parser/Parser-inl.h @@ -39,7 +39,7 @@ Scope3Parser<Callback>::~Scope3Parser() template<typename Callback> void Scope3Parser<Callback>:: -EnumerateHyperedges(const WordsRange &range, Callback &callback) +EnumerateHyperedges(const Range &range, Callback &callback) { const std::size_t start = range.GetStartPos(); const std::size_t end = range.GetEndPos(); diff --git a/moses/Syntax/S2T/Parsers/Scope3Parser/Parser.h b/moses/Syntax/S2T/Parsers/Scope3Parser/Parser.h index df2989d62..fa7adc200 100644 --- a/moses/Syntax/S2T/Parsers/Scope3Parser/Parser.h +++ b/moses/Syntax/S2T/Parsers/Scope3Parser/Parser.h @@ -5,7 +5,7 @@ #include "moses/Syntax/S2T/Parsers/Parser.h" #include "moses/Syntax/S2T/RuleTrieScope3.h" -#include "moses/WordsRange.h" +#include "moses/Range.h" #include "PatternApplicationTrie.h" #include "SymbolRangeCalculator.h" @@ -41,7 +41,7 @@ public: ~Scope3Parser(); - void EnumerateHyperedges(const WordsRange &, Callback &); + void EnumerateHyperedges(const Range &, Callback &); private: void Init(); diff --git a/moses/Syntax/S2T/RuleTrieLoader.cpp b/moses/Syntax/S2T/RuleTrieLoader.cpp index 3ac266bdb..4e3799253 100644 --- a/moses/Syntax/S2T/RuleTrieLoader.cpp +++ b/moses/Syntax/S2T/RuleTrieLoader.cpp @@ -15,7 +15,7 @@ #include "moses/Util.h" #include "moses/InputFileStream.h" #include "moses/StaticData.h" -#include "moses/WordsRange.h" +#include "moses/Range.h" #include "moses/ChartTranslationOptionList.h" #include "moses/FactorCollection.h" #include "moses/Syntax/RuleTableFF.h" diff --git a/moses/Syntax/T2S/InputTreeBuilder.cpp b/moses/Syntax/T2S/InputTreeBuilder.cpp index b72391f12..927c6b4e3 100644 --- a/moses/Syntax/T2S/InputTreeBuilder.cpp +++ b/moses/Syntax/T2S/InputTreeBuilder.cpp @@ -50,10 +50,10 @@ void InputTreeBuilder::CreateNodes(const TreeInput &in, p != xmlNodes.end(); ++p) { std::size_t start = p->m_range.GetStartPos(); std::size_t end = p->m_range.GetEndPos(); - nonTerms.push_back(XMLParseOutput(p->m_label, WordsRange(start+1, end+1))); + nonTerms.push_back(XMLParseOutput(p->m_label, Range(start+1, end+1))); } // Add a top-level node that also covers <s> and </s>. - nonTerms.push_back(XMLParseOutput(topLevelLabel, WordsRange(0, numWords-1))); + nonTerms.push_back(XMLParseOutput(topLevelLabel, Range(0, numWords-1))); // Allocate space for the InputTree nodes. In the case of out.nodes, this // step is essential because once created the PVertex objects must not be @@ -75,7 +75,7 @@ void InputTreeBuilder::CreateNodes(const TreeInput &in, // Add a node for each terminal to the left of or below the first // nonTerm child of the subtree. for (int i = prevEnd+1; i <= end; ++i) { - PVertex v(WordsRange(i, i), in.GetWord(i)); + PVertex v(Range(i, i), in.GetWord(i)); out.nodes.push_back(InputTree::Node(v)); out.nodesAtPos[i].push_back(&out.nodes.back()); } @@ -83,7 +83,7 @@ void InputTreeBuilder::CreateNodes(const TreeInput &in, // Add a node for the non-terminal. Word w(true); w.CreateFromString(Moses::Output, m_outputFactorOrder, p->m_label, true); - PVertex v(WordsRange(start, end), w); + PVertex v(Range(start, end), w); out.nodes.push_back(InputTree::Node(v)); out.nodesAtPos[start].push_back(&out.nodes.back()); diff --git a/moses/Syntax/T2S/RuleTrieLoader.cpp b/moses/Syntax/T2S/RuleTrieLoader.cpp index f0646b1f7..71d4b24d0 100644 --- a/moses/Syntax/T2S/RuleTrieLoader.cpp +++ b/moses/Syntax/T2S/RuleTrieLoader.cpp @@ -15,7 +15,7 @@ #include "moses/Util.h" #include "moses/InputFileStream.h" #include "moses/StaticData.h" -#include "moses/WordsRange.h" +#include "moses/Range.h" #include "moses/ChartTranslationOptionList.h" #include "moses/FactorCollection.h" #include "moses/Syntax/RuleTableFF.h" |