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 <fishandfrolick@gmail.com>2012-06-16 03:38:50 +0400
committerHieu Hoang <fishandfrolick@gmail.com>2012-06-16 03:38:50 +0400
commite71f76a3e5099b95b5dff08510399f5df01a0f51 (patch)
tree966748abe454a99a58ecd62fb3bc4b57beb0f34f /OnDiskPt
parent454ef13442463838581f9bc00f3dd42c408d9e4b (diff)
delete unused function
Diffstat (limited to 'OnDiskPt')
-rw-r--r--OnDiskPt/Vocab.cpp21
-rw-r--r--OnDiskPt/Vocab.h9
2 files changed, 7 insertions, 23 deletions
diff --git a/OnDiskPt/Vocab.cpp b/OnDiskPt/Vocab.cpp
index 0ed9ffa2a..a6ab68cdd 100644
--- a/OnDiskPt/Vocab.cpp
+++ b/OnDiskPt/Vocab.cpp
@@ -21,7 +21,6 @@
#include <fstream>
#include "OnDiskWrapper.h"
#include "Vocab.h"
-#include "../moses/src/FactorCollection.h"
using namespace std;
@@ -69,13 +68,13 @@ void Vocab::Save(OnDiskWrapper &onDiskWrapper)
}
}
-UINT64 Vocab::AddVocabId(const std::string &factorString)
+UINT64 Vocab::AddVocabId(const std::string &str)
{
// find string id
- CollType::const_iterator iter = m_vocabColl.find(factorString);
+ CollType::const_iterator iter = m_vocabColl.find(str);
if (iter == m_vocabColl.end()) {
// add new vocab entry
- m_vocabColl[factorString] = m_nextId;
+ m_vocabColl[str] = m_nextId;
return m_nextId++;
} else {
// return existing entry
@@ -83,10 +82,10 @@ UINT64 Vocab::AddVocabId(const std::string &factorString)
}
}
-UINT64 Vocab::GetVocabId(const std::string &factorString, bool &found) const
+UINT64 Vocab::GetVocabId(const std::string &str, bool &found) const
{
// find string id
- CollType::const_iterator iter = m_vocabColl.find(factorString);
+ CollType::const_iterator iter = m_vocabColl.find(str);
if (iter == m_vocabColl.end()) {
found = false;
return 0; //return whatever
@@ -97,14 +96,4 @@ UINT64 Vocab::GetVocabId(const std::string &factorString, bool &found) const
}
}
-const Moses::Factor *Vocab::GetFactor(UINT32 vocabId, Moses::FactorType factorType, Moses::FactorDirection direction, bool isNonTerminal) const
-{
- string str = GetString(vocabId);
- if (isNonTerminal) {
- str = str.substr(1, str.size() - 2);
- }
- const Moses::Factor *factor = Moses::FactorCollection::Instance().AddFactor(direction, factorType, str);
- return factor;
-}
-
}
diff --git a/OnDiskPt/Vocab.h b/OnDiskPt/Vocab.h
index f8c1dd649..60c5085c7 100644
--- a/OnDiskPt/Vocab.h
+++ b/OnDiskPt/Vocab.h
@@ -22,10 +22,6 @@
#include <map>
#include "../moses/src/TypeDef.h"
-namespace Moses
-{
-class Factor;
-}
namespace OnDiskPt
{
@@ -45,9 +41,8 @@ public:
Vocab()
:m_nextId(1)
{}
- UINT64 AddVocabId(const std::string &factorString);
- UINT64 GetVocabId(const std::string &factorString, bool &found) const;
- const Moses::Factor *GetFactor(UINT32 vocabId, Moses::FactorType factorType, Moses::FactorDirection direction, bool isNonTerminal) const;
+ UINT64 AddVocabId(const std::string &str);
+ UINT64 GetVocabId(const std::string &str, bool &found) const;
const std::string &GetString(UINT32 vocabId) const {
return m_lookup[vocabId];
}