本文整理汇总了C++中AnalysisContent::removeData方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisContent::removeData方法的具体用法?C++ AnalysisContent::removeData怎么用?C++ AnalysisContent::removeData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnalysisContent
的用法示例。
在下文中一共展示了AnalysisContent::removeData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handler
LimaStatusCode SpecificEntitiesLoader::
process(AnalysisContent& analysis) const
{
// get analysis graph
AnalysisGraph* graph=static_cast<AnalysisGraph*>(analysis.getData(m_graph));
if (graph==0)
{
LOGINIT("LP::SpecificEntities");
LERROR << "no graph '" << m_graph << "' available !";
return MISSING_DATA;
}
//create a RecognizerData (such as in ApplyRecognizer) to be able to use
//CreateSpecificEntity actions
RecognizerData* recoData=new RecognizerData;
analysis.setData("RecognizerData",recoData);
RecognizerResultData* resultData=new RecognizerResultData(m_graph);
recoData->setResultData(resultData);
try
{
SpecificEntitiesLoader::XMLHandler handler(m_language,analysis,graph);
m_parser->setContentHandler(&handler);
m_parser->setErrorHandler(&handler);
QFile file(getInputFile(analysis).c_str());
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
throw XMLException();
if (!m_parser->parse( QXmlInputSource(&file)))
{
throw XMLException();
}
}
catch (const XMLException& )
{
LOGINIT("LP::SpecificEntities");
LERROR << "Error: failed to parse XML input file";
}
// remove recognizer data (used only internally to this process unit)
recoData->deleteResultData();
resultData=0;
analysis.removeData("RecognizerData");
return SUCCESS_ID;
}