Jump to content

Archived

This topic is now archived and is closed to further replies.

oracle259

text similarity

Recommended Posts

apart from the built in similar_text() function how do i go about testing the similarity between two words.

Share this post


Link to post
Share on other sites
*NOTE: ~ means simular
i dont think i get the exact thing here do u want to know if they are ~ or do u want to define the difference?

if u want to see if they are ~ then just do like

[code]
<?php
If($var1==$var2) {
  echo("They are the same.");
}else{
  echo("They aren't the same.");
}
?>
[/code]

Share this post


Link to post
Share on other sites
Not really...in php you can use the following code:

[code]
$match = similar_text($compare1, $compare2, $percent);
$percent = round($percent, 0);
echo $pecent;
[/code]

to get the percentage similarity between ass and assets. But the percent comes to 0 which is not accurate i want to know if there is a better way to achieve a more accurate figure.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.