#include "../common/COMSyntaxHolder.h"
#include "../common/utilit.h"
int main(int argc, char* argv[])
{
::CoInitialize(0);
{
CCOMSyntaxHolder SyntaxHolder;
if (!SyntaxHolder.LoadSyntax(morphRussian))
return -1;
if (!SyntaxHolder.GetSentencesFromSynAn("мама мыла раму", FALSE, FALSE, FALSE))
return -1;
for(int i = 0 ; i < SyntaxHolder.m_piSentCollection->SentencesCount ; i++ )
{
SYNANLib::ISentencePtr piSent = SyntaxHolder.m_piSentCollection->GetSentence(i);
for(int j = 0 ; j < piSent->ClausesCount ; j++ )
{
SYNANLib::IClausePtr piClause = piSent->Clause[j];
if (piClause->VariantsCount == 0)
{
printf (" Error! A clause with no morph. variant is found\n");
continue;
};
for(int k = 0 ; k < piClause->ClauseVariant[0]->GroupsCount ; k++ )
{
SYNANLib::IGroupPtr piGroup = piClause->ClauseVariant[0]->Group[k];
SYNANLib::IWordPtr piW1 = piSent->Word[piGroup->FirstWord];
SYNANLib::IWordPtr piW2 = piSent->Word[piGroup->LastWord];
printf("(%s %s %s )\n",
(const char*)piGroup->TypeStr,
(const char*)piW1->WordStr,
(const char*)piW2->WordStr
);
}
}
}
}
::CoUninitialize();
return 0;
}