1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
try
{ // 1
ErrorCode = 0;
pListSemanticElement = new std::list<ElementSemantic*>();
wssRequest << "SELECT "
<< "ES.nuIdElemn, ES.nuIdTypeElement, ES.nuIdOccurence, ES.wsText, ES.vcName, ES.nuidpar, ES.siNbChunk, ES.siIdD, EC.nuIdChunk, C.nuIdChunkType, C.siNbWord, C.nuIdDrivingPos, W.nuIdWord, W.vcString, W.siIdPOS, L.cExcluded, L.siIdPOS"
<< " FROM"
<< " T_ELEMENT_SEMANTIQUE ES"
<< " LEFT JOIN T_ELEMENT_CHK EC ON ES.nuIdElemn = EC.nuIdElemn"
<< " LEFT JOIN T_CHUNK C ON EC.nuIdChunk = C.nuIdChunk"
<< " LEFT JOIN T_CHUNK_WORD CW ON C.nuIdChunk = CW.nuIdChunk"
<< " LEFT JOIN T_WORD W ON CW.nuIdWord = W.nuIdWord"
<< " LEFT JOIN T_LEMMA L ON W.nuIdLemma = L.nuIdLemma"
<< " AND W.siIdPOS = L.siIdPOS"
<< " WHERE ES.siIdD = " << iIdDoc
<< " ORDER BY ES.nuIdOccurence DESC, ES.vcName, ES.nuIdElemn, EC.siChkRank, CW.siWordRank";
dwNbResultFound = 0;
ErrorCode |= objInterbaseManager.ExecuteSelectRequest(wssRequest.str(), &dwNbResultFound);
if( dwNbResultFound == 0)
{ // 2
return( pListSemanticElement);
} // 2
iSize = 0;
ErrorCode |= objInterbaseManager.First();
while( bEndReached != true && ErrorCode == INIT_NO_ERROR && iSize < dwNbResultFound)
{ // 2
pelementSemantic = new ElementSemantic();
elementSemantic = *pelementSemantic;
pUnivers = new stUnivers();
elementSemantic.Univers = *pUnivers;
ErrorCode |= objInterbaseManager.GetWideString(4, wsTemp);
elementSemantic.wsText = wsTemp;
ErrorCode |= objInterbaseManager.GetWideString(5, wsTemp);
std::wstring wsUnivers = wsTemp;
ErrorCode |= objInterbaseManager.GetWideString(13, wsTemp);
elementSemantic.wsWord = wsTemp;
ErrorCode |= objInterbaseManager.GetHidDB(0, (int64_t&)elementSemantic.nuIdElemn);
ErrorCode |= objInterbaseManager.GetHidDB(1, (int64_t&)elementSemantic.nuIdTypeElement);
ErrorCode |= objInterbaseManager.GetHidDB(2, (int64_t&)elementSemantic.siIdOccurence);
ErrorCode |= objInterbaseManager.GetHidDB(6, (int64_t&)idParagraph);
ErrorCode |= objInterbaseManager.GetHidDB(7, (int64_t&) elementSemantic.siNbChunk);
ErrorCode |= objInterbaseManager.GetHidDB(8, (int64_t&) elementSemantic.iIdDoc);
ErrorCode |= objInterbaseManager.GetHidDB(9, (int64_t&) elementSemantic.nuIdChunk);
ErrorCode |= objInterbaseManager.GetHidDB(10, (int64_t&) elementSemantic.nuIdChunkType);
ErrorCode |= objInterbaseManager.GetHidDB(11, (int64_t&) elementSemantic.siNbWord);
ErrorCode |= objInterbaseManager.GetHidDB(12, (int64_t&) elementSemantic.nuIdDrivingPos);
ErrorCode |= objInterbaseManager.GetHidDB(14, (int64_t&) elementSemantic.iValWord);
ErrorCode |= objInterbaseManager.GetHidDB(15, (int64_t&) elementSemantic.iPOS);
elementSemantic.Univers.wsName = wsUnivers;
elementSemantic.Univers.idParagraph = idParagraph;
pListSemanticElement->push_back( &elementSemantic);
if( elementSemantic.nuIdTypeElement == 5) // un titre
{ // 3
if( wsOldText != elementSemantic.wsText)
{ // 4
wsOldText = elementSemantic.wsText;
} // 4
} // 3
iSize++;
ErrorCode |= objInterbaseManager.Next(bEndReached);
} // 2
} // 1 |
Partager