Intellexer Clusterizer can be easily integrated into custom Document/Knowledge management systems using programming languages C/C++ and C#. Our SDK contains all necessary include files and import libraries for binding user applications with Clusterizer module.
Here is a C++ example of how to add Intellexer Clusterizer to your application:
#include <iostream>
#include <ClustyI.h>
#include <ClustyIInput.h>
#include <LPXml.h>
using std::cout;
using std::cerr;
using namespace NsSemSDK;
int main(int argc, char* argv[])
{
try
{
char szPath[] = "../../LDB"; //path to ldb
char szQuery[] = "Electromagnetic radiation"; //query
const int nRecordCount = 3;
char szHeads[nRecordCount][100] = //heads
{
"Electromagnetic Spectrum - Introduction",
"Electromagnetic Radiation",
"Electromagnetic Waves"
};
char szBodies[nRecordCount][300] = //bodies
{
"Each photon contains a certain amount (or bundle) of energy, and all electromagnetic radiation consists of these photons. The only difference between the various types of electromagnetic radiation is the amount of energy found in the ...",
"All these devices make use of electromagnetic waves. Radio waves, microwaves, visible light, and x rays are all examples of ... Scientists have observed that electromagnetic radiation has a dual \"personality.\" Besides acting like waves, ...",
"Light, microwaves, x-rays, and TV and radio transmissions are all kinds of electromagnetic waves. They are all the same kind of wavy disturbance that repeats itself over a distance called the wavelength. ..."
};
// provide path to license file
SetClusterizerLicensePath("../../ISDK_License.xml");
SetLPXMLLicensePath("../../ISDK_License.xml");
// Load database
CInterfacePtr<IClustyDB> pClusterizerDB(CreateClustyDB(szPath));
CInterfacePtr<IRelTree> pRelTree;
//Initialize IClustyInput interface
CInterfacePtr<IClustyInput> pInput(pClusterizerDB->InputHA(""));
//Set query
pInput->SetQuery(szQuery, (int)strlen(szQuery));
//Add records for processing
for (int i = 0; i < nRecordCount; i++)
{
pInput->AddRecord(szHeads[i], (int)strlen(szHeads[i]), szBodies[i], (int)strlen(szBodies[i]), i);
}
//Notify end of input
pInput->EndInput();
//Get resulting tree
pRelTree.Reset(pInput->CopyTree());
//Print tree if not empty
if (pRelTree->Size() != 0)
{
IRelTree::IIt* pIt = pRelTree->GetIt();
do
{
cout << pIt->GetText() << "\t"
<< (const_cast<IRelTree*>(pIt->GetTree()))->GetTreeID() << "\t"
<< (unsigned)pIt->GetUniqueID(NULL) << "\n";
}
while(pIt->Next());
}
}
catch (const CSemBaseException& x)
{
// Handle exceptions.
cerr << x.what();
}
return 0;
As a result, all informative terms from sample documents will be grouped into hierarchical tree structure.