PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Pashkov Denis Igorevich   String Matrix   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: example
Class: String Matrix
Find similar words in different strings
Author: By
Last change:
Date: 11 years ago
Size: 2,634 bytes
 

Contents

Class file image Download
<html>

<body>
<style>

  .tracert{
      width:100%;
  }
    .tracert tr td{
        padding:10px;
        border : 1px solid red;
    }
</style>
<?php
date_default_timezone_set
( "Europe/Moscow" );
include
"Matrix.php" ;
echo
"Matrix Text test";
 

$matrix = new Matrix() ;
$matrix->setMulti(1.6); // Radius max delimetr highest threshold more accurate results
$matrix->setLimit(5.1); // Set Limit for Touches word. highest threshold more accurate results

// SetString
$matrix->AddString( new MatrixString("Shares of semiconductor maker Himax Technologies are jumping in pre-market trading with the news that Google has taken a 6.3% stake in Himax Display (HDI). HDI is a subsidiary of the Taiwanese company that focuses on liquid crystal on silicon (LCOS) chips and modules, which are used in Google Glass and other products. HDI also counts Kleiner Perkins, Khosla Ventures and Intel as investors",3));
$matrix->AddString( new MatrixString("It looks like Google is about to unleash a new wave of more powerful applications for Google Glass. Currently, ",3));
$matrix->AddString( new MatrixString(" Glass developers can only build apps that are essentially web-based services that talk to the user’s hardware through a set of relatively limited APIs. ",7));
$matrix->AddString( new MatrixString(" At its I/O developer conference earlier this year, Google announced that it would soon release its so-called Glass Development Kit ",8));
$matrix->AddString( new MatrixString("The new Glass app brings Hippflow updates to Google’s wearable computer once a user has linked their Hippflow and Google Glass account ",9));
$matrix->AddString( new MatrixString("As Google makes more moves into positioning itself as a vertically-integrated tech player beyond software and cloud-based services, the company’s stake in HDI could grow. Himax says that the 6.3% stake includes an option to make an additional investment in more preferred shares within the next year. If exercised in full, Google can take up to a 14.8% share in HDI. ",10));

 
 echo
$matrix ;
 
 echo
"<br> </br> ";
 echo
" HEight ". $matrix->getHeight();
 echo
"<br>";
 echo
"Width: ". $matrix->getWidth() ;
 
 
echo
"<hr> <p> testing hasSimilarwords: </p> ";
var_dump($matrix->hasSimilar("developers"));
echo
"<hr> <p> get Touched for word 'developers' : </p> ";


 foreach(
$matrix->getSimilar("developers") as $w)
     echo
"<p> {$w->string} </p>";

 
 echo
"<hr> <p> testing return ids of similar strings for id 10 : </p> ";
 
 
print_r($matrix->getSimilarTo(10));
 
 
?>

 </body>
 </html>