// override
// Bit of a hack here to ensure a reasonable function for the sentrans
// process, based on what sequence its in.  If we're in a transfer
// sequence, then that must be the goal.
CProcess* CSentransProcessTemplate::createProcess(int iSeqFunctionCode, SFMFile* pInputFile)
{
	CProcess* p = CProcessTemplate::createProcess(iSeqFunctionCode, pInputFile);
	ASSERTX(p->IsKindOf(RUNTIME_CLASS(CSentransProcess)));
	if(-1 != iSeqFunctionCode)
	{
		switch(iSeqFunctionCode)
		{
			case CProcess::kAnalysis:
				// note that the user can change this to kAdjustSrcAnalysis. THis
				// is just the default.
				((CSentransProcess*)p)->m_iFunction = CSentransProcess::kDisambig;
				break;
			case CProcess::kInterlinear:
				((CSentransProcess*)p)->m_iFunction = CSentransProcess::kAdjustSrcGlossing;
				break;
			case CProcess::kTransfer:
				((CSentransProcess*)p)->m_iFunction = CSentransProcess::kTransfer;
				break;
			default: ASSERTX(FALSE);
		}
		// else leave it to the default
	}
	return p;
}
예제 #2
0
CProcess* CProcessTemplate::createProcess(int iSeqFunctionCode, SFMFile* pInputFile)
{
	CProcess* pObject = (CProcess*)m_pClass->CreateObject();
	if(pObject)
	{
		ASSERTX( pObject->IsKindOf( m_pClass ));
		if(pInputFile)
			pObject->readParametersFromSFMFile(pInputFile);
	}
	else
		AfxMessageBox("Couldn't create the process.\n");

	return pObject;
}