function findDocuments() { //Find documents and metadata from various sources //for loop through each source // for each document found in the source: $doc = new document(); //How to save document found in the current source $doc->add_url("http://eventful.com/event/1"); $doc->name = "dancefestival"; $doc->add_artist("who"); $doc->description = "This is a test, for the decompose-test. Decomposition available availability. It didn't work filing"; $doc = decomposeDocument($doc); $doc = multiLabelClassification($doc); foreach ($doc->tags as $tag) { echo "{$tag} <br>"; } $doc = clusterDocument($doc); $doc = findDuplicate($doc); saveToIndex($doc); }