[dasher] Combine PinYinConversionHelper into MandarinAlphMgr
- From: Patrick Welche <pwelche src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dasher] Combine PinYinConversionHelper into MandarinAlphMgr
- Date: Mon, 17 May 2010 11:44:09 +0000 (UTC)
commit a3fbf552324bcad96a88a493330aa8e3830a4636
Author: Alan Lawrence <acl33 inf phy cam ac uk>
Date: Sat May 1 21:29:52 2010 +0100
Combine PinYinConversionHelper into MandarinAlphMgr
Moving Convert from PinyinParser into MandarinAlphMgr
Duplicating necessary code from Conversion{Manager,Helper} into MandAMgr also...
...but large overall reduction, and all "Conversion" code only used by Japanese
(inc. SCENode & many hacks etc. for Alph/Conv Mgr interaction) - remove?
Also replaced CDasherNode::mgrId() with mgr(), using _marker_ class CNodeManager
Src/DasherCore/AlphabetManager.cpp | 12 +-
Src/DasherCore/AlphabetManager.h | 10 +-
Src/DasherCore/ControlManager.h | 5 +-
Src/DasherCore/ConversionHelper.cpp | 2 +-
Src/DasherCore/ConversionManager.cpp | 2 +-
Src/DasherCore/ConversionManager.h | 5 +-
Src/DasherCore/DasherNode.h | 7 +-
.../LanguageModelling/PPMPYLanguageModel.cpp | 61 ++---
.../LanguageModelling/PPMPYLanguageModel.h | 2 +-
Src/DasherCore/Makefile.am | 2 -
Src/DasherCore/MandarinAlphMgr.cpp | 258 +++++++++++++++++---
Src/DasherCore/MandarinAlphMgr.h | 52 ++++-
Src/DasherCore/NodeCreationManager.cpp | 8 -
Src/DasherCore/NodeManager.h | 10 +
Src/DasherCore/PinYinConversionHelper.cpp | 224 -----------------
Src/DasherCore/PinYinConversionHelper.h | 64 -----
Src/DasherCore/PinyinParser.cpp | 31 +---
Src/DasherCore/PinyinParser.h | 20 +-
Src/MacOSX/Dasher.xcodeproj/project.pbxproj | 6 -
19 files changed, 336 insertions(+), 445 deletions(-)
---
diff --git a/Src/DasherCore/AlphabetManager.cpp b/Src/DasherCore/AlphabetManager.cpp
index 9ee0c98..f7b1132 100644
--- a/Src/DasherCore/AlphabetManager.cpp
+++ b/Src/DasherCore/AlphabetManager.cpp
@@ -54,7 +54,7 @@ CAlphabetManager::CAlphabetManager(CDasherInterfaceBase *pInterface, CNodeCreati
}
CAlphabetManager::CAlphNode::CAlphNode(CDasherNode *pParent, unsigned int iLbnd, unsigned int iHbnd, CDasherNode::SDisplayInfo *pDisplayInfo, CAlphabetManager *pMgr)
-: CDasherNode(pParent, iLbnd, iHbnd, pDisplayInfo), m_pMgr(pMgr), m_pProbInfo(NULL) {
+: CDasherNode(pParent, iLbnd, iHbnd, pDisplayInfo), m_pProbInfo(NULL), m_pMgr(pMgr) {
};
CAlphabetManager::CSymbolNode::CSymbolNode(CDasherNode *pParent, unsigned int iLbnd, unsigned int iHbnd, CDasherNode::SDisplayInfo *pDisplayInfo, CAlphabetManager *pMgr, symbol _iSymbol)
@@ -195,7 +195,7 @@ std::vector<unsigned int> *CAlphabetManager::CAlphNode::GetProbInfo() {
}
std::vector<unsigned int> *CAlphabetManager::CGroupNode::GetProbInfo() {
- if (m_pGroup && Parent() && Parent()->mgrId() == 0) {
+ if (m_pGroup && Parent() && Parent()->mgr() == mgr()) {
DASHER_ASSERT(Parent()->m_iOffset == m_iOffset);
return (static_cast<CAlphNode *>(Parent()))->GetProbInfo();
}
@@ -393,10 +393,14 @@ CAlphabetManager::CAlphNode::~CAlphNode() {
m_pMgr->m_pLanguageModel->ReleaseContext(iContext);
}
+const std::string &CAlphabetManager::CSymbolNode::outputText() {
+ return mgr()->m_pNCManager->GetAlphabet()->GetText(iSymbol);
+}
+
void CAlphabetManager::CSymbolNode::Output(Dasher::VECTOR_SYMBOL_PROB* pAdded, int iNormalization) {
//std::cout << this << " " << Parent() << ": Output at offset " << m_iOffset << " *" << m_pMgr->m_pNCManager->GetAlphabet()->GetText(t) << "* " << std::endl;
- Dasher::CEditEvent oEvent(1, m_pMgr->m_pNCManager->GetAlphabet()->GetText(iSymbol), m_iOffset);
+ Dasher::CEditEvent oEvent(1, outputText(), m_iOffset);
m_pMgr->m_pNCManager->InsertEvent(&oEvent);
// Track this symbol and its probability for logging purposes
@@ -410,7 +414,7 @@ void CAlphabetManager::CSymbolNode::Output(Dasher::VECTOR_SYMBOL_PROB* pAdded, i
}
void CAlphabetManager::CSymbolNode::Undo() {
- Dasher::CEditEvent oEvent(2, m_pMgr->m_pNCManager->GetAlphabet()->GetText(iSymbol), m_iOffset);
+ Dasher::CEditEvent oEvent(2, outputText(), m_iOffset);
m_pMgr->m_pNCManager->InsertEvent(&oEvent);
}
diff --git a/Src/DasherCore/AlphabetManager.h b/Src/DasherCore/AlphabetManager.h
index 14afdd1..a301870 100644
--- a/Src/DasherCore/AlphabetManager.h
+++ b/Src/DasherCore/AlphabetManager.h
@@ -24,6 +24,7 @@
#include "LanguageModelling/LanguageModel.h"
#include "DasherNode.h"
#include "Parameters.h"
+#include "NodeManager.h"
class CNodeCreationManager;
struct SGroupInfo;
@@ -40,7 +41,7 @@ namespace Dasher {
/// to the appropriate alphabet file, with sizes given by the
/// language model.
///
- class CAlphabetManager {
+ class CAlphabetManager : public CNodeManager {
public:
CAlphabetManager(CDasherInterfaceBase *pInterface, CNodeCreationManager *pNCManager, CLanguageModel *pLanguageModel);
@@ -49,7 +50,7 @@ namespace Dasher {
class CGroupNode;
class CAlphNode : public CDasherNode {
public:
- int mgrId() {return 0;}
+ virtual CAlphabetManager *mgr() {return m_pMgr;}
CAlphNode(CDasherNode *pParent, unsigned int iLbnd, unsigned int iHbnd, CDasherNode::SDisplayInfo *pDispInfo, CAlphabetManager *pMgr);
CLanguageModel::Context iContext;
///
@@ -61,11 +62,12 @@ namespace Dasher {
///Have to call this from CAlphabetManager, and from CGroupNode on a _different_ CAlphNode, hence public...
virtual std::vector<unsigned int> *GetProbInfo();
virtual int ExpectedNumChildren();
- CAlphabetManager *m_pMgr;
virtual CDasherNode *RebuildSymbol(CAlphNode *pParent, symbol iSymbol, unsigned int iLbnd, unsigned int iHbnd)=0;
virtual CGroupNode *RebuildGroup(CAlphNode *pParent, SGroupInfo *pInfo, unsigned int iLbnd, unsigned int iHbnd)=0;
private:
std::vector<unsigned int> *m_pProbInfo;
+ protected:
+ CAlphabetManager *m_pMgr;
};
class CSymbolNode : public CAlphNode {
public:
@@ -88,6 +90,8 @@ namespace Dasher {
const symbol iSymbol;
virtual CDasherNode *RebuildSymbol(CAlphNode *pParent, symbol iSymbol, unsigned int iLbnd, unsigned int iHbnd);
virtual CGroupNode *RebuildGroup(CAlphNode *pParent, SGroupInfo *pInfo, unsigned int iLbnd, unsigned int iHbnd);
+ private:
+ virtual const std::string &outputText();
};
class CGroupNode : public CAlphNode {
diff --git a/Src/DasherCore/ControlManager.h b/Src/DasherCore/ControlManager.h
index e923f6f..3cc47d3 100644
--- a/Src/DasherCore/ControlManager.h
+++ b/Src/DasherCore/ControlManager.h
@@ -24,6 +24,7 @@
#include "DasherModel.h"
#include "DasherNode.h"
#include "Event.h"
+#include "NodeManager.h"
#include <vector>
#include <map>
@@ -51,7 +52,7 @@ namespace Dasher {
/// Currently can only have one instance due to use
/// of static members for callbacks from expat.
///
- class CControlManager {
+ class CControlManager : public CNodeManager {
public:
enum { CTL_ROOT, CTL_STOP, CTL_PAUSE, CTL_MOVE, CTL_MOVE_FORWARD,
@@ -88,7 +89,7 @@ namespace Dasher {
class CContNode : public CDasherNode {
public:
- int mgrId() {return 1;}
+ CControlManager *mgr() {return m_pMgr;}
CContNode(CDasherNode *pParent, unsigned int iLbnd, unsigned int iHbnd, CDasherNode::SDisplayInfo *pDisplayInfo, CControlManager *pMgr);
///
/// Provide children for the supplied node
diff --git a/Src/DasherCore/ConversionHelper.cpp b/Src/DasherCore/ConversionHelper.cpp
index c201449..7ec9f2e 100644
--- a/Src/DasherCore/ConversionHelper.cpp
+++ b/Src/DasherCore/ConversionHelper.cpp
@@ -180,7 +180,7 @@ void CConversionHelper::BuildTree(CConvHNode *pRoot) {
std::string strCurrentString;
// Search backwards but stop at any conversion node.
for (CDasherNode *pNode = pRoot->Parent();
- pNode && pNode->mgrId() != 2;
+ pNode && pNode->mgr() == this;
pNode = pNode->Parent()) {
// TODO: Need to make this the edit text rather than the display text
diff --git a/Src/DasherCore/ConversionManager.cpp b/Src/DasherCore/ConversionManager.cpp
index c9238e5..2b41eb7 100644
--- a/Src/DasherCore/ConversionManager.cpp
+++ b/Src/DasherCore/ConversionManager.cpp
@@ -154,7 +154,7 @@ void CConversionManager::CConvNode::Output(Dasher::VECTOR_SYMBOL_PROB* pAdded, i
Dasher::CEditEvent oEvent(1, pCurrentSCENode->pszConversion, m_iOffset);
m_pMgr->m_pNCManager->InsertEvent(&oEvent);
- if((GetChildren())[0]->mgrId() == 2) {
+ if((GetChildren())[0]->mgr() == m_pMgr) {
if (static_cast<CConvNode *>(GetChildren()[0])->m_pMgr == m_pMgr) {
Dasher::CEditEvent oEvent(11, "", 0);
m_pMgr->m_pNCManager->InsertEvent(&oEvent);
diff --git a/Src/DasherCore/ConversionManager.h b/Src/DasherCore/ConversionManager.h
index 3cfa1ed..02d5d05 100644
--- a/Src/DasherCore/ConversionManager.h
+++ b/Src/DasherCore/ConversionManager.h
@@ -25,6 +25,7 @@
#include "LanguageModelling/LanguageModel.h" // Urgh - we really shouldn't need to know about language models here
#include "DasherNode.h"
#include "SCENode.h"
+#include "NodeManager.h"
// TODO: Conversion manager needs to deal with offsets and contexts - Will: See Phil for an explanation.
@@ -56,7 +57,7 @@ namespace Dasher {
/// aspects of conversion, and CNodeManager for details of the node
/// management process.
///
- class CConversionManager {
+ class CConversionManager : public CNodeManager {
public:
// TODO: We shouldn't need to know about this stuff, but the code is somewhat in knots at the moment
CConversionManager(CNodeCreationManager *pNCManager, CAlphabet *pAlphabet);
@@ -80,7 +81,7 @@ namespace Dasher {
protected:
class CConvNode : public CDasherNode {
public:
- int mgrId() {return 2;}
+ CConversionManager *mgr() {return m_pMgr;}
CConvNode(CDasherNode *pParent, unsigned int iLbnd, unsigned int iHbnd, CDasherNode::SDisplayInfo *pDispInfo, CConversionManager *pMgr);
///
/// Provide children for the supplied node
diff --git a/Src/DasherCore/DasherNode.h b/Src/DasherCore/DasherNode.h
index 892f060..0d16529 100644
--- a/Src/DasherCore/DasherNode.h
+++ b/Src/DasherCore/DasherNode.h
@@ -25,6 +25,8 @@
#include "../Common/NoClones.h"
#include "LanguageModelling/LanguageModel.h"
#include "DasherTypes.h"
+#include "NodeManager.h"
+
namespace Dasher {
class CDasherNode;
class CDasherInterfaceBase;
@@ -206,7 +208,10 @@ class Dasher::CDasherNode:private NoClones {
/// @name Management routines (once accessed via NodeManager)
/// @{
- virtual int mgrId() = 0;
+ /// Gets the node manager for this object. Meaning defined by subclasses,
+ /// which should override and refine the return type appropriately;
+ /// the main use is to provide runtime type info to check casting!
+ virtual CNodeManager *mgr() = 0;
///
/// Provide children for the supplied node
///
diff --git a/Src/DasherCore/LanguageModelling/PPMPYLanguageModel.cpp b/Src/DasherCore/LanguageModelling/PPMPYLanguageModel.cpp
index 169469e..89257a5 100644
--- a/Src/DasherCore/LanguageModelling/PPMPYLanguageModel.cpp
+++ b/Src/DasherCore/LanguageModelling/PPMPYLanguageModel.cpp
@@ -187,11 +187,11 @@ void CPPMPYLanguageModel::GetProbs(Context context, std::vector<unsigned int> &p
DASHER_ASSERT(iToSpend == 0);
}
-void CPPMPYLanguageModel::GetPartProbs(Context context, const std::vector<SCENode *> &vChildren, int norm, int iUniform){
+void CPPMPYLanguageModel::GetPartProbs(Context context, std::vector<pair<symbol, unsigned int> > &vChildren, int norm, int iUniform){
if(vChildren.size() == 1){
- vChildren[0]->NodeSize = norm;
+ vChildren[0].second = norm;
return;
}
// std::cout<<"Norms is "<<norm<<std::endl;
@@ -204,37 +204,28 @@ void CPPMPYLanguageModel::GetPartProbs(Context context, const std::vector<SCENod
// std::cout<<"size of context set "<<m_setContexts.size()<<std::endl;
// probs.resize(iNumSymbols);
-
- // Leave the vector treatment for now
- std::vector < bool > exclusions(vChildren.size());
unsigned int iToSpend = norm;
unsigned int iUniformLeft = iUniform;
// TODO: Sort out zero symbol case
- exclusions[0] = false;
//Reproduce iterative calculations with SCENode trie
if(vChildren.size()){
- vChildren[0] -> NodeSize = 0;
+ vChildren[0].second = 0;
int i=1;
- for (std::vector<SCENode *>::const_iterator it = vChildren.begin()+1; it!=vChildren.end(); it++) {
- SCENode *pNode(*it);
- pNode->NodeSize = iUniformLeft / (vChildren.size() - i);
+ for (std::vector<pair<symbol, unsigned int> >::iterator it = vChildren.begin()+1; it!=vChildren.end(); it++) {
+ it->second = iUniformLeft / (vChildren.size() - i);
// std::cout<<"iUniformLeft: "<<iUniformLeft<<std::endl;
- iUniformLeft -= pNode->NodeSize;
- iToSpend -= pNode->NodeSize;
- exclusions[i] = false;
+ iUniformLeft -= it->second;
+ iToSpend -= it->second;
i++;
}
}
DASHER_ASSERT(iUniformLeft == 0);
- // bool doExclusion = GetLongParameter( LP_LM_ALPHA );
- bool doExclusion = 0; //FIXME
-
int alpha = GetLongParameter( LP_LM_ALPHA );
int beta = GetLongParameter( LP_LM_BETA );
@@ -247,12 +238,11 @@ void CPPMPYLanguageModel::GetPartProbs(Context context, const std::vector<SCENod
int iTotal =0;
vNodeStore.clear();
int i=0;
- for (std::vector<SCENode *>::const_iterator it = vChildren.begin(); it!=vChildren.end(); it++) {
- SCENode *pNode(*it);
+ for (std::vector<pair<symbol, unsigned int> >::const_iterator it = vChildren.begin(); it!=vChildren.end(); it++) {
- pFound = pTemp->find_symbol(pNode->Symbol);
+ pFound = pTemp->find_symbol(it->first);
//Mark: do we need to treat the exception of -1 separately?
- if((!(exclusions[i] && doExclusion))&&(pFound)){
+ if(pFound){
iTotal += pFound->count;
vNodeStore.push_back(pFound);
}
@@ -268,13 +258,11 @@ void CPPMPYLanguageModel::GetPartProbs(Context context, const std::vector<SCENod
unsigned int size_of_slice = iToSpend;
int i=0;
- for (vector<SCENode *>::const_iterator it = vChildren.begin(); it!=vChildren.end(); it++) {
- SCENode *pNode(*it);
- if((!(exclusions[i] && doExclusion))&&(vNodeStore[i])) {
- exclusions[i] = 1;
+ for (vector<pair<symbol, unsigned int> >::iterator it = vChildren.begin(); it!=vChildren.end(); it++) {
+ if(vNodeStore[i]) {
unsigned int p = static_cast < myint > (size_of_slice) * (100 * vNodeStore[i]->count - beta) / (100 * iTotal + alpha);
- if((pNode->Symbol>-1)&&(pNode->Symbol<=m_iAlphSize)){
- pNode->NodeSize += p;
+ if((it->first>-1)&&(it->first<=m_iAlphSize)){
+ it->second += p;
iToSpend -= p;
}
}
@@ -288,12 +276,7 @@ void CPPMPYLanguageModel::GetPartProbs(Context context, const std::vector<SCENod
unsigned int size_of_slice = iToSpend;
- int symbolsleft = 0;
-
- for(unsigned int i = 1; i < vChildren.size(); i++)
- if(!(exclusions[i] && doExclusion))
- symbolsleft++;
-
+ int symbolsleft = vChildren.size()-1;
// std::ostringstream str;
// for (sym=0;sym<modelchars;sym++)
@@ -310,12 +293,10 @@ void CPPMPYLanguageModel::GetPartProbs(Context context, const std::vector<SCENod
if(vChildren.size()) {
int i=1;
- for (std::vector<SCENode *>::const_iterator it = vChildren.begin()+1; it!=vChildren.end(); it++) {
- if(!(exclusions[i] && doExclusion)) {
- unsigned int p = size_of_slice / symbolsleft;
- (*it)->NodeSize += p;
- iToSpend -= p;
- }
+ for (std::vector<pair<symbol, unsigned int> >::iterator it = vChildren.begin()+1; it!=vChildren.end(); it++) {
+ unsigned int p = size_of_slice / symbolsleft;
+ it->second += p;
+ iToSpend -= p;
i++;
}
}
@@ -325,12 +306,12 @@ void CPPMPYLanguageModel::GetPartProbs(Context context, const std::vector<SCENod
if(vChildren.size()) {
// std::cout<<"iNumsyjbols "<<vChildren.size()<<std::endl;
- for (std::vector<SCENode *>::const_iterator it = vChildren.begin()+1; it!=vChildren.end(); it++) {
+ for (std::vector<pair<symbol, unsigned int> >::iterator it = vChildren.begin()+1; it!=vChildren.end(); it++) {
// std::cout<<"iLeft "<<iLeft<<std::endl;
// std::cout<<"iToSpend "<<iToSpend<<std::endl;
unsigned int p = iToSpend / iLeft;
- (*it)->NodeSize += p;
+ it->second += p;
--iLeft;
iToSpend -= p;
}
diff --git a/Src/DasherCore/LanguageModelling/PPMPYLanguageModel.h b/Src/DasherCore/LanguageModelling/PPMPYLanguageModel.h
index 1fe2c42..7ad933d 100644
--- a/Src/DasherCore/LanguageModelling/PPMPYLanguageModel.h
+++ b/Src/DasherCore/LanguageModelling/PPMPYLanguageModel.h
@@ -90,7 +90,7 @@ namespace Dasher {
virtual void GetProbs(Context context, std::vector < unsigned int >&Probs, int norm, int iUniform) const;
void GetPYProbs(Context context, std::vector < unsigned int >&Probs, int norm, int iUniform);
- void GetPartProbs(Context context, const std::vector<SCENode *> &vChildren, int norm, int iUniform);
+ void GetPartProbs(Context context, std::vector<std::pair<symbol, unsigned int> > &vChildren, int norm, int iUniform);
void dump();
diff --git a/Src/DasherCore/Makefile.am b/Src/DasherCore/Makefile.am
index 217d8a4..e4c8f68 100644
--- a/Src/DasherCore/Makefile.am
+++ b/Src/DasherCore/Makefile.am
@@ -148,8 +148,6 @@ libdashercore_a_DEPENDENCIES = @CHINESE_SOURCES@ @JAPANESE_SOURCES@
EXTRA_libdashercore_a_SOURCES = \
CannaConversionHelper.cpp \
CannaConversionHelper.h \
- PinYinConversionHelper.cpp \
- PinYinConversionHelper.h \
PinyinParser.cpp \
PinyinParser.h
diff --git a/Src/DasherCore/MandarinAlphMgr.cpp b/Src/DasherCore/MandarinAlphMgr.cpp
index 5d1e462..7c700fa 100644
--- a/Src/DasherCore/MandarinAlphMgr.cpp
+++ b/Src/DasherCore/MandarinAlphMgr.cpp
@@ -21,8 +21,7 @@
#include "../Common/Common.h"
#include "MandarinAlphMgr.h"
-#include "PinYinConversionHelper.h"
-#include "ConversionManager.h"
+#include "PPMPYLanguageModel.h"
#include "DasherInterfaceBase.h"
#include "DasherNode.h"
#include "Event.h"
@@ -34,6 +33,7 @@
#include <sstream>
#include <iostream>
+using namespace std;
using namespace Dasher;
// Track memory leaks on Windows to the line that new'd the memory
@@ -47,38 +47,13 @@ static char THIS_FILE[] = __FILE__;
#endif
CMandarinAlphMgr::CMandarinAlphMgr(CDasherInterfaceBase *pInterface, CNodeCreationManager *pNCManager, CLanguageModel *pLanguageModel)
- : CAlphabetManager(pInterface, pNCManager, pLanguageModel) {
+ : CAlphabetManager(pInterface, pNCManager, pLanguageModel),
+ m_pParser(new CPinyinParser(pInterface->GetStringParameter(SP_SYSTEM_LOC) +"/alphabet.chineseRuby.xml")),
+ m_pCHAlphabet(new CAlphabet(pInterface->GetInfo("Chinese / ç®?ä½?ä¸æ?? (simplified chinese, in pin yin groups)"))) {
}
-CAlphabetManager::CAlphNode *CMandarinAlphMgr::GetRoot(CDasherNode *pParent, unsigned int iLower, unsigned int iUpper, bool bEnteredLast, int iOffset) {
- CAlphNode *pNewNode;
- if (!bEnteredLast) {
- //(probably) escaping back to alphabet after conversion. At any rate, we'll duplicate a lot of
- // superclass node-construction code, to avoid building a context - as we're going to throw that away
- // (and the context-building code often doesn't work with conversion!)...
- CDasherNode::SDisplayInfo *pDispInfo = new CDasherNode::SDisplayInfo;
- pDispInfo->bShove = true;
- pDispInfo->bVisible = true;
- pDispInfo->strDisplayText = "";
- pDispInfo->iColour = m_pNCManager->GetAlphabet()->GetColour(0, 0);
- pNewNode = makeGroup(pParent, iLower, iUpper, pDispInfo, NULL);
- pNewNode->m_iOffset=max(0,iOffset)-1;
- } else {
- //probably rebuilding parent; call standard GetRoot, which'll extract the most recent symbol
- // (entered by the node (equivalent to that) which we are rebuilding)
- pNewNode = CAlphabetManager::GetRoot(pParent, iLower, iUpper, bEnteredLast, iOffset);
- }
-
- //Override context for Mandarin Dasher
- if (pParent && pParent->mgrId() == 2) {
- //ACL MandarinAlphMgr should always be used with a PinYinConversionHelper,
- //so this cast really should be ok :-)....but I still wish for a guarantee!
- CPinYinConversionHelper::CPYConvNode *pPYParent = static_cast<CPinYinConversionHelper::CPYConvNode *>(pParent);
- pNewNode->iContext = m_pLanguageModel->CloneContext(pPYParent->GetConvContext());
- } else
- pNewNode->iContext = m_pLanguageModel->CreateEmptyContext();
-
- return pNewNode;
+CMandarinAlphMgr::~CMandarinAlphMgr() {
+ delete m_pParser;
}
CDasherNode *CMandarinAlphMgr::CreateSymbolNode(CAlphNode *pParent, symbol iSymbol, unsigned int iLbnd, unsigned int iHbnd) {
@@ -89,31 +64,240 @@ CDasherNode *CMandarinAlphMgr::CreateSymbolNode(CAlphNode *pParent, symbol iSymb
//The following logic switch allows punctuation nodes in Mandarin to be treated in the same way as English (i.e. display and populate next round) instead of invoking a conversion node
//ACL I think by "the following logic switch" he meant that symbols <= 1288 are "normal" nodes, NOT punctuation nodes,
// whereas punctuation is handled by the fallthrough case (standard AlphabetManager CreateSymbolNode)
- CDasherNode *pNewNode = m_pNCManager->GetConvRoot(pParent, iLbnd, iHbnd, pParent->m_iOffset+1);
- static_cast<CPinYinConversionHelper::CPYConvNode *>(pNewNode)->SetConvSymbol(iSymbol);
+
+ /*old code:
+ * CDasherNode *pNewNode = m_pNCManager->GetConvRoot(pParent, iLbnd, iHbnd, pParent->m_iOffset+1);
+ * static_cast<CPinYinConversionHelper::CPYConvNode *>(pNewNode)->SetConvSymbol(iSymbol);
+ * return pNewNode;
+ */
+
+ //from ConversionManager:
+ CDasherNode::SDisplayInfo *pInfo = new CDasherNode::SDisplayInfo;
+ pInfo->bVisible = true;
+ pInfo->bShove = true;
+ pInfo->strDisplayText = "";
+ pInfo->iColour = 9;
+ //CTrieNode parallels old PinyinConversionHelper's SetConvSymbol:
+ CConvRoot *pNewNode = new CConvRoot(pParent, iLbnd, iHbnd, pInfo, this, m_pParser->GetTrieNode(m_pNCManager->GetAlphabet()->GetDisplayText(iSymbol)));
+ pNewNode->m_iOffset = pParent->m_iOffset+1;
+ //from ConversionHelper:
+ //pNewNode->m_pLanguageModel = m_pLanguageModel;
+ pNewNode->iContext = m_pLanguageModel->CloneContext(pParent->iContext);
+
return pNewNode;
}
return CAlphabetManager::CreateSymbolNode(pParent, iSymbol, iLbnd, iHbnd);
}
+CMandarinAlphMgr::CConvRoot::CConvRoot(CDasherNode *pParent, unsigned int iLbnd, unsigned int iHbnd, SDisplayInfo *pDisplayInfo, CMandarinAlphMgr *pMgr, CTrieNode *pTrie)
+: CDasherNode(pParent, iLbnd, iHbnd, pDisplayInfo), m_pMgr(pMgr), m_pTrie(pTrie) {
+
+}
+
+int CMandarinAlphMgr::CConvRoot::ExpectedNumChildren() {
+ if (m_vChInfo.empty()) BuildConversions();
+ return m_vChInfo.size();
+}
+
+void CMandarinAlphMgr::CConvRoot::BuildConversions() {
+ if (!m_pTrie || !m_pTrie->list()) {
+ //TODO some kind of fallback??? e.g. start new char?
+ DASHER_ASSERT(false);
+ return;
+ }
+ for(set<string>::iterator it = m_pTrie->list()->begin(); it != m_pTrie->list()->end(); ++it) {
+ std::vector<symbol> vSyms;
+ m_pMgr->m_pCHAlphabet->GetSymbols(vSyms, *it);
+ DASHER_ASSERT(vSyms.size()==1); //does it ever happen? if so, Will's code would effectively push -1
+ DASHER_ASSERT(m_pMgr->m_pCHAlphabet->GetText(vSyms[0]) == *it);
+ m_vChInfo.push_back(std::pair<symbol, unsigned int>(vSyms[0],0));
+ }
+ //TODO would be nicer to do this only if we need the size info (i.e. PopulateChildren not ExpectedNumChildren) ?
+ m_pMgr->AssignSizes(m_vChInfo, iContext);
+}
+
+void CMandarinAlphMgr::CConvRoot::PopulateChildren() {
+ if (m_vChInfo.empty()) BuildConversions();
+
+ int iIdx(0);
+ int iCum(0);
+
+ // int parentClr = pNode->Colour();
+ // TODO: Fixme
+ int parentClr = 0;
+ // Finally loop through and create the children
+
+ for (vector<pair<symbol, unsigned int> >::const_iterator it = m_vChInfo.begin(); it!=m_vChInfo.end(); it++) {
+ // std::cout << "Current scec: " << pCurrentSCEChild << std::endl;
+ unsigned int iLbnd(iCum);
+ unsigned int iHbnd(iCum + it->second);
+
+ iCum = iHbnd;
+
+ // TODO: Parameters here are placeholders - need to figure out
+ // what's right
+
+ CDasherNode::SDisplayInfo *pDisplayInfo = new CDasherNode::SDisplayInfo;
+ pDisplayInfo->iColour = m_pMgr->AssignColour(parentClr, iIdx);
+ pDisplayInfo->bShove = true;
+ pDisplayInfo->bVisible = true;
+
+ // std::cout << "#" << pCurrentSCEChild->pszConversion << "#" << std::endl;
+
+ //The chinese characters are in the _text_ (not label - that's e.g. "liang4")
+ // of the alphabet (& the pszConversion from PinyinParser was converted to symbol
+ // by CAlphabet::GetSymbols, which does string->symbol by _text_; we're reversing that)
+ pDisplayInfo->strDisplayText = m_pMgr->m_pCHAlphabet->GetText(it->first);
+
+ CMandNode *pNewNode = new CMandSym(this, iLbnd, iHbnd, pDisplayInfo, m_pMgr, it->first);
+
+ // TODO: Reimplement ----
+
+ // FIXME - handle context properly
+ // pNewNode->SetContext(m_pLanguageModel->CreateEmptyContext());
+ // -----
+
+ pNewNode->m_iOffset = m_iOffset + 1;
+
+ pNewNode->iContext = m_pMgr->m_pLanguageModel->CloneContext(this->iContext);
+
+ m_pMgr->m_pLanguageModel->EnterSymbol(iContext, it->first); // TODO: Don't use symbols?
+
+ DASHER_ASSERT(GetChildren().back()==pNewNode);
+
+ ++iIdx;
+ }
+
+}
+
+void CMandarinAlphMgr::AssignSizes(std::vector<pair<symbol,unsigned int> > &vChildren, Dasher::CLanguageModel::Context context) {
+
+ const int iNorm(m_pNCManager->GetLongParameter(LP_NORMALIZATION));
+ const int uniform(m_pNCManager->GetLongParameter(LP_UNIFORM));
+
+ int iSymbols = m_pNCManager->GetAlphabet()->GetNumberSymbols();
+ int iRemaining(iNorm);
+
+ //Kept normalization base from old code
+ const int uniform_add(((iNorm * uniform) / 1000) / (iSymbols - 2)); // Subtract 2 from no symbols to lose control/root nodes;
+ const int nonuniform_norm(iNorm - (iSymbols - 2) * uniform_add);
+
+ unsigned long long int sumProb=0;
+
+ //CLanguageModel::Context iCurrentContext;
+
+ // std::cout<<"size of symbolstore "<<SymbolStore.size()<<std::endl;
+
+ // std::cout<<"norm input: "<<nonuniform_norm/(iSymbols/iNChildren/100)<<std::endl;
+
+ static_cast<CPPMPYLanguageModel *>(m_pLanguageModel)->GetPartProbs(context, vChildren, nonuniform_norm, 0);
+
+ //std::cout<<"after get probs "<<std::endl;
+
+ for (std::vector<pair<symbol,unsigned int> >::const_iterator it = vChildren.begin(); it!=vChildren.end(); it++) {
+ sumProb += it->second;
+ }
+
+ // std::cout<<"Sum Prob "<<sumProb<<std::endl;
+ // std::cout<<"norm "<<nonuniform_norm<<std::endl;
+
+ //Match, sumProbs = nonuniform_norm
+ //but fix one element 'Da4'
+ // Finally, iterate through the nodes and actually assign the sizes.
+
+ // std::cout<<"sumProb "<<sumProb<<std::endl;
+
+ for (std::vector<pair<symbol,unsigned int> >::iterator it = vChildren.begin(); it!=vChildren.end(); it++) {
+ DASHER_ASSERT(it->first>-1); //ACL Will's code tested for both these conditions explicitly, and if so
+ DASHER_ASSERT(sumProb>0); //then used a probability if 0 (well, max(1,0)=>1). I don't think either
+ //should ever happen if the alphabet files are right (there'd have to
+ //be either no conversions of the syllable+tone, or else the LM'd have
+ //to assign zero probability to each), so I'm removing these tests for now...
+ iRemaining -= it->second = max(1,int((it->second*iNorm)/sumProb));
+
+ // std::cout<<pNode->pszConversion<<std::endl;
+ // std::cout<<pNode->Symbol<<std::endl;
+ // std::cout<<"Probs i "<<pNode<<std::endl;
+ // std::cout<<"Symbol i"<<SymbolStore[iIdx]<<std::endl;
+ // std::cout<<"symbols size "<<SymbolStore.size()<<std::endl;
+ // std::cout<<"Symbols address "<<&SymbolStore<<std::endl;
+ }
+
+ //std::cout<<"iRemaining "<<iRemaining<<std::endl;
+
+
+ // Last of all, allocate anything left over due to rounding error
+
+ int iLeft(vChildren.size());
+
+ for (std::vector<pair<symbol,unsigned int> >::iterator it = vChildren.begin(); it!=vChildren.end(); it++) {
+ int iDiff(iRemaining / iLeft);
+
+ it->second += iDiff;
+
+ iRemaining -= iDiff;
+ --iLeft;
+
+ // std::cout<<"Node size for "<<pNode->pszConversion<<std::endl;
+ //std::cout<<"is "<<pNode->NodeSize<<std::endl;
+ }
+
+}
+
+static int colourStore[2][3] = {
+ {66,//light blue
+ 64,//very light green
+ 62},//light yellow
+ {78,//light purple
+ 81,//brownish
+ 60},//red
+};
+
+//Pulled from CConversionHelper, where it's described as "needing a rethink"...
+int CMandarinAlphMgr::AssignColour(int parentClr, int childIndex) {
+ int which = -1;
+
+ for (int i=0; i<2; i++)
+ for(int j=0; j<3; j++)
+ if (parentClr == colourStore[i][j])
+ which = i;
+
+ if(which == -1)
+ return colourStore[0][childIndex%3];
+ else if(which == 0)
+ return colourStore[1][childIndex%3];
+ else
+ return colourStore[0][childIndex%3];
+};
+
+
CLanguageModel::Context CMandarinAlphMgr::CreateSymbolContext(CAlphNode *pParent, symbol iSymbol)
{
//Context carry-over. This code may worth looking at debug
return m_pLanguageModel->CloneContext(pParent->iContext);
}
-CMandarinAlphMgr::CMandNode::CMandNode(CDasherNode *pParent, unsigned int iLbnd, unsigned int iHbnd, CDasherNode::SDisplayInfo *pDispInfo, CAlphabetManager *pMgr, symbol iSymbol)
+CMandarinAlphMgr::CMandNode::CMandNode(CDasherNode *pParent, unsigned int iLbnd, unsigned int iHbnd, CDasherNode::SDisplayInfo *pDispInfo, CMandarinAlphMgr *pMgr, symbol iSymbol)
: CSymbolNode(pParent, iLbnd, iHbnd, pDispInfo, pMgr, iSymbol) {
}
-CAlphabetManager::CSymbolNode *CMandarinAlphMgr::makeSymbol(CDasherNode *pParent, unsigned int iLbnd, unsigned int iHbnd, CDasherNode::SDisplayInfo *pDispInfo, symbol iSymbol) {
+CMandarinAlphMgr::CMandNode *CMandarinAlphMgr::makeSymbol(CDasherNode *pParent, unsigned int iLbnd, unsigned int iHbnd, CDasherNode::SDisplayInfo *pDispInfo, symbol iSymbol) {
return new CMandNode(pParent, iLbnd, iHbnd, pDispInfo, this, iSymbol);
}
void CMandarinAlphMgr::CMandNode::SetFlag(int iFlag, bool bValue) {
- //disable learn-as-you-write for Mandarin Dasher
+ //``disable learn-as-you-write for Mandarin Dasher''
if (iFlag==NF_COMMITTED)
CDasherNode::SetFlag(iFlag, bValue); //bypass CAlphNode setter!
else
CAlphNode::SetFlag(iFlag, bValue);
}
+
+CMandarinAlphMgr::CMandSym::CMandSym(CDasherNode *pParent, unsigned int iLbnd, unsigned int iHbnd, CDasherNode::SDisplayInfo *pDispInfo, CMandarinAlphMgr *pMgr, symbol iSymbol)
+: CMandNode(pParent, iLbnd, iHbnd, pDispInfo, pMgr, iSymbol) {
+}
+
+const std::string &CMandarinAlphMgr::CMandSym::outputText() {
+ //use chinese, not pinyin, alphabet...
+ return mgr()->m_pCHAlphabet->GetText(iSymbol);
+}
diff --git a/Src/DasherCore/MandarinAlphMgr.h b/Src/DasherCore/MandarinAlphMgr.h
index 8af8d53..b0abadb 100644
--- a/Src/DasherCore/MandarinAlphMgr.h
+++ b/Src/DasherCore/MandarinAlphMgr.h
@@ -22,6 +22,7 @@
#define __mandarinalphmgr_h__
#include "AlphabetManager.h"
+#include "PinyinParser.h"
namespace Dasher {
@@ -37,21 +38,56 @@ namespace Dasher {
CMandarinAlphMgr(CDasherInterfaceBase *pInterface, CNodeCreationManager *pNCManager, CLanguageModel *pLanguageModel);
- ///
- /// Get a new root node owned by this manager
- ///
-
- virtual CAlphNode *GetRoot(CDasherNode *pParent, unsigned int iLower, unsigned int iUpper, bool bEnteredLast, int iOffset);
-
+ virtual ~CMandarinAlphMgr();
+
+ /*ACL note: used to override GetRoot,
+ to attempt to clone the context of the previous node
+ in the case that the previous node was a PinyinConversionHelper node
+ (the common case - when a "conversion" was performed and chinese symbols reached,
+ it then 'escaped' back to the alphabet manager root by calling GetAlphRoot...)
+ Since this is no longer necessary (chinese symbol nodes are alph nodes directly,
+ so subsume the previous role of alph 'root's rather than contain them),
+ I don't think we need to override GetRoot anymore...?!?! */
+
protected:
+ ///Subclass CSymbolNode to disable learn-as-you-write (for Mandarin Dasher).
+ /// This subclass used directly only for punctuation; chinese symbols use CMandSym, below.
class CMandNode : public CSymbolNode {
public:
- CMandNode(CDasherNode *pParent, unsigned int iLbnd, unsigned int iHbnd, CDasherNode::SDisplayInfo *pDispInfo, CAlphabetManager *pMgr, symbol iSymbol);
+ CMandarinAlphMgr *mgr() {return static_cast<CMandarinAlphMgr *>(CSymbolNode::mgr());}
+ CMandNode(CDasherNode *pParent, unsigned int iLbnd, unsigned int iHbnd, CDasherNode::SDisplayInfo *pDispInfo, CMandarinAlphMgr *pMgr, symbol iSymbol);
virtual void SetFlag(int iFlag, bool bValue);
+ virtual CDasherNode *RebuildParent() {return 0;}
+ };
+ class CMandSym : public CMandNode {
+ public:
+ CMandSym(CDasherNode *pParent, unsigned int iLbnd, unsigned int iHbnd, CDasherNode::SDisplayInfo *pDispInfo, CMandarinAlphMgr *pMgr, symbol iSymbol);
+ private:
+ virtual const std::string &outputText();
};
- CSymbolNode *makeSymbol(CDasherNode *pParent, unsigned int iLbnd, unsigned int iHbnd, CDasherNode::SDisplayInfo *pDispInfo, symbol iSymbol);
+ class CConvRoot : public CDasherNode {
+ public:
+ CMandarinAlphMgr *mgr() {return m_pMgr;}
+ CConvRoot(CDasherNode *pParent, unsigned int iLbnd, unsigned int iHbnd, CDasherNode::SDisplayInfo *pDispInfo, CMandarinAlphMgr *pMgr, CTrieNode *pTrie);
+ void PopulateChildren();
+ int ExpectedNumChildren();
+ int iContext;
+ private:
+ void BuildConversions();
+
+ std::vector<std::pair<symbol, unsigned int> > m_vChInfo;
+ CMandarinAlphMgr *m_pMgr;
+ CTrieNode *m_pTrie;
+ };
+ CMandNode *makeSymbol(CDasherNode *pParent, unsigned int iLbnd, unsigned int iHbnd, CDasherNode::SDisplayInfo *pDispInfo, symbol iSymbol);
virtual CDasherNode *CreateSymbolNode(CAlphNode *pParent, symbol iSymbol, unsigned int iLbnd, unsigned int iHbnd);
virtual CLanguageModel::Context CreateSymbolContext(CAlphNode *pParent, symbol iSymbol);
+
+ int AssignColour(int parentClr, int childIndex);
+
+ void AssignSizes(std::vector<std::pair<symbol,unsigned int> > &vChildren, Dasher::CLanguageModel::Context context);
+ CPinyinParser *m_pParser;
+ CAlphabet *m_pCHAlphabet;
};
/// @}
diff --git a/Src/DasherCore/NodeCreationManager.cpp b/Src/DasherCore/NodeCreationManager.cpp
index 8854355..54661f9 100644
--- a/Src/DasherCore/NodeCreationManager.cpp
+++ b/Src/DasherCore/NodeCreationManager.cpp
@@ -8,7 +8,6 @@
#include "LanguageModelling/CTWLanguageModel.h"
#include "NodeCreationManager.h"
#include "MandarinAlphMgr.h"
-#include "PinYinConversionHelper.h"
#include "ControlManager.h"
#include "EventHandler.h"
@@ -145,13 +144,6 @@ CNodeCreationManager::CNodeCreationManager(Dasher::CDasherInterfaceBase *pInterf
#endif
break;
#endif
-#ifdef CHINESE
- case 2: // Chinese
- m_pConversionManager = new CPinYinConversionHelper(this, m_pEventHandler, m_pSettingsStore, pAlphIO,
- GetStringParameter(SP_SYSTEM_LOC) +"/alphabet.chineseRuby.xml",
- m_pAlphabet, static_cast<CPPMPYLanguageModel *>(m_pLanguageModel));
- break;
-#endif
}
}
diff --git a/Src/DasherCore/NodeManager.h b/Src/DasherCore/NodeManager.h
new file mode 100644
index 0000000..a53f951
--- /dev/null
+++ b/Src/DasherCore/NodeManager.h
@@ -0,0 +1,10 @@
+#ifndef __nodemanager_h__
+#define __nodemanager_h__
+namespace Dasher {
+
+ /// A marker class for anything that can be returned by CDasherNode::mgr()
+ /// - as a void* return type can't be covariantly overridden :-(
+ class CNodeManager {
+ };
+}
+#endif
diff --git a/Src/DasherCore/PinyinParser.cpp b/Src/DasherCore/PinyinParser.cpp
index f21fdda..6b55ada 100644
--- a/Src/DasherCore/PinyinParser.cpp
+++ b/Src/DasherCore/PinyinParser.cpp
@@ -27,6 +27,7 @@
#include <string>
#include <vector>
+using namespace Dasher;
CPinyinParser::CPinyinParser(const std::string &strAlphabetPath) {
m_strLastGroup = "";
pCurrentList = NULL;
@@ -155,33 +156,3 @@ CTrieNode *CPinyinParser::GetTrieNode(const std::string &pystr) {
//the digit '9' seems to be used as a marker for 'end-of-string' in the trie...
return pCurrentNode->LookupChild('9');
}
-
-SCENode *CPinyinParser::Convert(CTrieNode *pCurrentNode) {
-
- if(!pCurrentNode || !pCurrentNode->m_pList)
- return NULL;
-
- SCENode *pRoot = new SCENode;
- pRoot->pszConversion = "";
-
- for(std::set<std::string>::iterator it = pCurrentNode->m_pList->begin(); it != pCurrentNode->m_pList->end(); ++it) {
- SCENode *pNewNode = new SCENode;
-
- pNewNode->pszConversion = new char[it->size() + 1];
- strcpy(pNewNode->pszConversion, it->c_str());
-
- // std::string strChar(pNewNode->pszConversion);
- // std::cout<<"Mandarin Char: "<<strChar<<std::endl;
- // std::vector<int> CHSym;
- // m_pCHAlphabet->GetSymbols(&CHSym, &strChar, 0);
- // pNewNode->Symbol = CHSym[0];
-
- pRoot->AddChild(pNewNode);
- }
-
- //Test code: will make program crash
- // SCENode * pTemp = *pRoot;
- // if(pTemp->GetChild()->GetChild())
- // std::cout<<"We have trouble in PYParser."<<std::endl;
- return pRoot;
-}
diff --git a/Src/DasherCore/PinyinParser.h b/Src/DasherCore/PinyinParser.h
index 8f62229..23c617b 100644
--- a/Src/DasherCore/PinyinParser.h
+++ b/Src/DasherCore/PinyinParser.h
@@ -21,13 +21,13 @@
#ifndef __PinyinParser_h__
#define __PinyinParser_h__
-#include "SCENode.h"
#include "Alphabet/Alphabet.h"
-
+#include "DasherTypes.h"
#include <expat.h>
#include <iostream>
#include <set>
#include <string>
+#include <vector>
class CTrieNode {
public:
@@ -106,16 +106,15 @@ public:
std::cout<<m_cSymbol<<std::endl;
}
- CTrieNode * GetChild(){
- return m_pChild;
+ const std::set<std::string> *list() {
+ return m_pList;
}
- std::set<std::string> *m_pList;
-
private:
CTrieNode *m_pChild;
CTrieNode *m_pNext;
-
+ std::set<std::string> *m_pList;
+
char m_cSymbol;
};
@@ -124,7 +123,8 @@ private:
// 2. This leaks memory badly
// 3. Generally make things sensible!
// 4. Load the conversion data from a configurable location, store in a sensible binary format
-
+namespace Dasher {
+
class CPinyinParser {
public:
/// Constructor
@@ -132,8 +132,6 @@ class CPinyinParser {
~CPinyinParser();
CTrieNode *GetTrieNode(const std::string &pystr);
- SCENode *Convert(CTrieNode *pCurrentNode);
-
private:
static void XML_StartElement(void *userData, const XML_Char * name, const XML_Char ** atts);
@@ -146,5 +144,5 @@ class CPinyinParser {
std::string m_strLastGroup;
CTrieNode *m_pRoot;
};
-
+}
#endif
diff --git a/Src/MacOSX/Dasher.xcodeproj/project.pbxproj b/Src/MacOSX/Dasher.xcodeproj/project.pbxproj
index 40126c0..0d89023 100755
--- a/Src/MacOSX/Dasher.xcodeproj/project.pbxproj
+++ b/Src/MacOSX/Dasher.xcodeproj/project.pbxproj
@@ -363,7 +363,6 @@
335901B41009E5A900821255 /* ConversionHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 335901B31009E5A900821255 /* ConversionHelper.cpp */; };
335DB0FB100B332C006DB155 /* alphabet.spyDict.xml in Resources */ = {isa = PBXBuildFile; fileRef = 335DB0FA100B332C006DB155 /* alphabet.spyDict.xml */; };
335DB101100B3358006DB155 /* training_spyDict.txt in Resources */ = {isa = PBXBuildFile; fileRef = 335DB100100B3358006DB155 /* training_spyDict.txt */; };
- 335DB122100B3606006DB155 /* PinYinConversionHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1948BE760C226CFD001DFA32 /* PinYinConversionHelper.cpp */; };
33ABFEC60FC379EA00EA2BA5 /* ButtonMultiPress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33ABFEC40FC379EA00EA2BA5 /* ButtonMultiPress.cpp */; };
33ABFEC70FC379EA00EA2BA5 /* ButtonMultiPress.h in Headers */ = {isa = PBXBuildFile; fileRef = 33ABFEC50FC379EA00EA2BA5 /* ButtonMultiPress.h */; };
33E173C70F3E0B6400D19B38 /* Makefile.am in Resources */ = {isa = PBXBuildFile; fileRef = 33E173A70F3E0B6400D19B38 /* Makefile.am */; };
@@ -525,8 +524,6 @@
1948BE730C226CFD001DFA32 /* OneDimensionalFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = OneDimensionalFilter.cpp; sourceTree = "<group>"; };
1948BE740C226CFD001DFA32 /* OneDimensionalFilter.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = OneDimensionalFilter.h; sourceTree = "<group>"; };
1948BE750C226CFD001DFA32 /* Parameters.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Parameters.h; sourceTree = "<group>"; };
- 1948BE760C226CFD001DFA32 /* PinYinConversionHelper.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; path = PinYinConversionHelper.cpp; sourceTree = "<group>"; };
- 1948BE770C226CFD001DFA32 /* PinYinConversionHelper.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PinYinConversionHelper.h; sourceTree = "<group>"; };
1948BE780C226CFD001DFA32 /* SCENode.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SCENode.cpp; sourceTree = "<group>"; };
1948BE790C226CFD001DFA32 /* SCENode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SCENode.h; sourceTree = "<group>"; };
1948BE7A0C226CFD001DFA32 /* SettingsStore.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SettingsStore.cpp; sourceTree = "<group>"; };
@@ -1021,8 +1018,6 @@
1948BE730C226CFD001DFA32 /* OneDimensionalFilter.cpp */,
1948BE740C226CFD001DFA32 /* OneDimensionalFilter.h */,
1948BE750C226CFD001DFA32 /* Parameters.h */,
- 1948BE760C226CFD001DFA32 /* PinYinConversionHelper.cpp */,
- 1948BE770C226CFD001DFA32 /* PinYinConversionHelper.h */,
1948BE780C226CFD001DFA32 /* SCENode.cpp */,
1948BE790C226CFD001DFA32 /* SCENode.h */,
1948BE7A0C226CFD001DFA32 /* SettingsStore.cpp */,
@@ -1846,7 +1841,6 @@
3306E0220FFD1CE60017324C /* PPMPYLanguageModel.cpp in Sources */,
3306E1F70FFE6CAD0017324C /* Trainer.cpp in Sources */,
3306E33D0FFFB9880017324C /* MandarinAlphMgr.cpp in Sources */,
- 335DB122100B3606006DB155 /* PinYinConversionHelper.cpp in Sources */,
335901B41009E5A900821255 /* ConversionHelper.cpp in Sources */,
33135351102C6D8E00E28220 /* AlternatingDirectMode.cpp in Sources */,
33135353102C6D8E00E28220 /* CompassMode.cpp in Sources */,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]