<?php
/* 
 * A sample PHP code for the Termine Web Service.
 * This code requires PHP version 5 or later with the SOAP extension enabled.
 */

// This is a sample sentence from which terms are extracted.
$sentence = "Technical terms are important for knowledge mining, especially in the bio-medical area where vast amount of documents are available.";

// Create an object to access the Termine Web Service.
$client = new SoapClient("http://www.nactem.ac.uk/software/termine/webservice/termine.wsdl");

// Call the service with default options.
print "--- Default ---\n";
print $client->analyze($sentence);
print "\n";

// Analyze the same text and obtain the result in XML.
print "--- XML output ---\n";
print $client->analyze($sentence, "", "xml");
print "\n";

// Register words 'area' and 'amount' to stoplist.
print "--- Apply stoplist, 'area' and 'amount' ---\n";
print $client->analyze($sentence, "", "", "area amount");
print "\n";

// Modify the linguistic filter to extract prepositional phrases.
print "--- Modify the linguistic filter to '{IN}{DT}*{JJ}*{NN}+' ---\n";
print $client->analyze($sentence, "", "", "", "{IN}{DT}*{JJ}*{NN}+");
print "\n";

// Analyze the sentence with part-of-speech annotation.
print "--- Analyze a part-of-speech tagged (POST) sentence ---\n";
$post_sentence = <<<EOD
Technical	Technical	JJ
terms	term	NNS
are	be	VBP
important	important	JJ
for	for	IN
knowledge	knowledge	NN
mining	mining	NN
,	,	,
especially	especially	RB
in	in	IN
the	the	DT
bio-medical	bio-medical	JJ
area	area	NN
where	where	WRB
vast	vast	JJ
amount	amount	NN
of	of	IN
documents	document	NNS
are	be	VBP
available	available	JJ
.	.	.
EOS
EOD;
print $client->analyze($post_sentence, "post.genia");
print "\n"

?>