Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieu@hoang.co.uk>2014-06-16 17:37:36 +0400
committerHieu Hoang <hieu@hoang.co.uk>2014-06-16 17:37:36 +0400
commitb5b3aa802df626282cfb17d49c2e542cfef63e45 (patch)
tree1641b2b7d508eef7ca5bbf616ac8b0b2ed451e25 /moses/ChartCellCollection.h
parentf2d3f57d07186c2bcbb6adda6510bb2c23f733e0 (diff)
delete input path creation. Already doing it in ChartParser. SCFG algorithm needs a cleanup
Diffstat (limited to 'moses/ChartCellCollection.h')
-rw-r--r--moses/ChartCellCollection.h43
1 files changed, 0 insertions, 43 deletions
diff --git a/moses/ChartCellCollection.h b/moses/ChartCellCollection.h
index 210c32c18..1edeb4450 100644
--- a/moses/ChartCellCollection.h
+++ b/moses/ChartCellCollection.h
@@ -37,8 +37,6 @@ public:
template <class Factory> ChartCellCollectionBase(const InputType &input, const Factory &factory) :
m_cells(input.GetSize()) {
- CreateInputPaths(input);
-
size_t size = input.GetSize();
for (size_t startPos = 0; startPos < size; ++startPos) {
std::vector<ChartCellBase*> &inner = m_cells[startPos];
@@ -51,7 +49,6 @@ public:
* which needs to point somewhere, so I have it refer to the ChartCell.
*/
const WordsRange &range = inner[0]->GetCoverage();
- InputPath &path = GetInputPath(range.GetStartPos(), range.GetEndPos());
m_source.push_back(new ChartCellLabel(range, input.GetWord(startPos)));
}
@@ -59,34 +56,6 @@ public:
virtual ~ChartCellCollectionBase();
- void CreateInputPaths(const InputType &input)
- {
- size_t size = input.GetSize();
- m_inputPathMatrix.resize(size);
- for (size_t phaseSize = 1; phaseSize <= size; ++phaseSize) {
- for (size_t startPos = 0; startPos < size - phaseSize + 1; ++startPos) {
- size_t endPos = startPos + phaseSize -1;
- std::vector<InputPath*> &vec = m_inputPathMatrix[startPos];
-
- WordsRange range(startPos, endPos);
- Phrase subphrase(input.GetSubString(WordsRange(startPos, endPos)));
- const NonTerminalSet &labels = input.GetLabelSet(startPos, endPos);
-
- InputPath *path;
- if (range.GetNumWordsCovered() == 1) {
- path = new InputPath(subphrase, labels, range, NULL, NULL);
- vec.push_back(path);
- } else {
- const InputPath &prevPath = GetInputPath(startPos, endPos - 1);
- path = new InputPath(subphrase, labels, range, &prevPath, NULL);
- vec.push_back(path);
- }
-
- m_inputPathQueue.push_back(path);
- }
- }
-
- }
const ChartCellBase &GetBase(const WordsRange &coverage) const {
return *m_cells[coverage.GetStartPos()][coverage.GetEndPos() - coverage.GetStartPos()];
@@ -106,18 +75,6 @@ private:
boost::ptr_vector<ChartCellLabel> m_source;
- typedef std::vector< std::vector<InputPath*> > InputPathMatrix;
- InputPathMatrix m_inputPathMatrix; /*< contains translation options */
-
- InputPathList m_inputPathQueue;
-
- InputPath &GetInputPath(size_t startPos, size_t endPos)
- {
- size_t offset = endPos - startPos;
- assert(offset < m_inputPathMatrix[startPos].size());
- return *m_inputPathMatrix[startPos][offset];
- }
-
};
/** Hold all the chart cells for 1 input sentence. A variable of this type is held by the ChartManager