Test Ar-PHP Functionality Online

header line!
Test PHP Function



















Ar-PHP Manual

method highlightSummary [line 340]

string highlightSummary( string $str, integer $int, string $keywords, string $style)

Highlight key sentences (summary) of the input string (document content) using CSS and send the result back as an output



Tags:

return:  Output highlighted key sentences summary (using CSS)
author:  Khaled Al-Sham'aa <khaled@ar-php.org>
access:  public


Parameters:

string   $str   Input Arabic document as a string
integer   $int   Number of key sentences required to be highlighted in the input string (document content)
string   $keywords   List of keywords higlited by search process
string   $style   Name of the CSS class you would like to apply

Example
  1.  include('./I18N/Arabic.php');
  2.  $obj new I18N_Arabic('AutoSummarize');
  3.  
  4.  $file 'Examples/Articles/Ajax.txt';
  5.  $r 20;
  6.  
  7.  // get contents of a file into a string
  8.  $fhandle = fopen($file"r");
  9.  $c = fread($fhandlefilesize($file));
  10.  fclose($fhandle);
  11.  
  12.  $k $obj->getMetaKeywords($c$r);
  13.  echo '<b><font color=#FFFF00>';
  14.  echo 'Keywords:</font></b>';
  15.  echo '<p dir="rtl" align="justify">';
  16.  echo $k '</p>';
  17.  
  18.  $s $obj->doRateSummarize($c$r);
  19.  echo '<b><font color=#FFFF00>';
  20.  echo 'Summary:</font></b>';
  21.  echo '<p dir="rtl" align="justify">';
  22.  echo $s '</p>';
  23.  
  24.  echo '<b><font color=#FFFF00>';
  25.  echo 'Full Text:</font></b>';
  26.  echo '<p><a class=ar_link target=_blank ';
  27.  echo 'href='.$file.'>Source File</a></p>';
Popular
Recent
Links
Ads!
footer line!

No Software Patents! General Public License

Home | Twitter | Blog | Contact

Copyright © 2006 - 2016 Khaled Al-Sham'aa