[dasher] GC PinyinConversionHelper::Get{SumPY, }Probs, also many fields of SCENode



commit 8be28fb8b338e184b78da40f26b14e5b6a84c3c4
Author: Alan Lawrence <acl33 inf phy cam ac uk>
Date:   Fri Apr 30 14:02:23 2010 +0100

    GC PinyinConversionHelper::Get{SumPY,}Probs, also many fields of SCENode

 Src/DasherCore/ConversionManager.cpp      |    2 +-
 Src/DasherCore/PinYinConversionHelper.cpp |   27 ---------------------------
 Src/DasherCore/PinYinConversionHelper.h   |    4 ----
 Src/DasherCore/SCENode.h                  |   24 +++++++-----------------
 4 files changed, 8 insertions(+), 49 deletions(-)
---
diff --git a/Src/DasherCore/ConversionManager.cpp b/Src/DasherCore/ConversionManager.cpp
index 39413a3..c9238e5 100644
--- a/Src/DasherCore/ConversionManager.cpp
+++ b/Src/DasherCore/ConversionManager.cpp
@@ -121,7 +121,7 @@ void CConversionManager::RecursiveDumpTree(SCENode *pCurrent, unsigned int iDept
     SCENode *pCurrent(*it);
     for(unsigned int i(0); i < iDepth; ++i)
       std::cout << "-";
-    std::cout << " " << pCurrent->pszConversion << " " << pCurrent->IsHeadAndCandNum << " " << pCurrent->CandIndex << " " << pCurrent->IsComplete << " " << pCurrent->AcCharCount << std::endl;
+    std::cout << " " << pCurrent->pszConversion << std::endl;//" " << pCurrent->IsHeadAndCandNum << " " << pCurrent->CandIndex << " " << pCurrent->IsComplete << " " << pCurrent->AcCharCount << std::endl;
     RecursiveDumpTree(pCurrent, iDepth + 1);
   }
 }
diff --git a/Src/DasherCore/PinYinConversionHelper.cpp b/Src/DasherCore/PinYinConversionHelper.cpp
index fc44fe7..270b7ab 100644
--- a/Src/DasherCore/PinYinConversionHelper.cpp
+++ b/Src/DasherCore/PinYinConversionHelper.cpp
@@ -75,33 +75,6 @@ bool CPinYinConversionHelper::Convert(const std::string &strSource, SCENode ** p
   return (pParser && pParser->Convert(strSource, pRoot));
 }
 
-unsigned int CPinYinConversionHelper::GetSumPYProbs(Dasher::CLanguageModel::Context context, std::vector<SCENode *> &pPYCandStart, int norm){
-
-  std::vector <unsigned int> Probs;
-  unsigned int sumProb=0;
-  
-  GetLanguageModel()->GetProbs(context, Probs, norm, 0);
-
-  for (std::vector<SCENode *>::iterator it = pPYCandStart.begin(); it != pPYCandStart.end(); it++) {
-    SCENode *pCurrentNode(*it);
-    
-    std::vector <symbol >Symbols;
-    std::string HZ = static_cast<std::string>(pCurrentNode->pszConversion);
-    // Distribute the remaining space evenly
-    
-    m_pCHAlphabet->GetSymbols(Symbols, HZ);    
-
-    if(Symbols.size()!=0)
-      sumProb += Probs[Symbols[0]];
-
-  }
-
-  return sumProb;
-}
-
-void CPinYinConversionHelper::GetProbs(Dasher::CLanguageModel::Context context, std::vector < unsigned int >&Probs, int norm){
-}
-
 void CPinYinConversionHelper::AssignSizes(const std::vector<SCENode *> &vChildren, Dasher::CLanguageModel::Context context, long normalization, int uniform){
 
   //test print:
diff --git a/Src/DasherCore/PinYinConversionHelper.h b/Src/DasherCore/PinYinConversionHelper.h
index 0041d83..39e56bb 100644
--- a/Src/DasherCore/PinYinConversionHelper.h
+++ b/Src/DasherCore/PinYinConversionHelper.h
@@ -27,10 +27,6 @@ class CPinYinConversionHelper : public CConversionHelper {
 
   virtual void AssignSizes(const std::vector<SCENode *> &vChildren, Dasher::CLanguageModel::Context context , long normalization, int uniform);
 
-  virtual void GetProbs(Dasher::CLanguageModel::Context context, std::vector < unsigned int >&Probs, int norm);
-
-  virtual unsigned int GetSumPYProbs(Dasher::CLanguageModel::Context context, std::vector <SCENode *> &pPYCandStart,int norm);
-
 protected:
   class CPYConvNode : public CConvHNode {
   public:
diff --git a/Src/DasherCore/SCENode.h b/Src/DasherCore/SCENode.h
index b7dcbfb..f061008 100644
--- a/Src/DasherCore/SCENode.h
+++ b/Src/DasherCore/SCENode.h
@@ -54,34 +54,24 @@ class SCENode {
     pChild->Ref();
   }
 
-  void SetPriority(int iPriority) {
-    m_iPriority = iPriority;
-  };
-
-  int GetPriority() {
-    return m_iPriority;
-  };
-
   char *pszConversion;
 
-  int IsHeadAndCandNum;
-  int CandIndex;
+  //int IsHeadAndCandNum;
+  //int CandIndex;
   int Symbol;
-  unsigned int SumPYProbStore;
+  //unsigned int SumPYProbStore;
   
-  int IsComplete;
-  int AcCharCount;  /*accumulative character count*/
+  //int IsComplete;
+  //int AcCharCount;  /*accumulative character count*/
   
   int NodeSize;
   
-  unsigned int HZFreq;
-  float HZProb;
+  //unsigned int HZFreq;
+  //float HZProb;
  private:
   int m_iRefCount;
 
   std::vector<SCENode *> m_vChildren;
-
-  int m_iPriority;
 };
 /// \}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]