Jump to content


Photo

text similarity


  • Please log in to reply
3 replies to this topic

#1 oracle259

oracle259
  • Members
  • PipPipPip
  • Advanced Member
  • 119 posts

Posted 28 September 2006 - 02:53 AM

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

#2 BillyBoB

BillyBoB
  • Members
  • PipPipPip
  • Advanced Member
  • 630 posts

Posted 28 September 2006 - 03:39 AM

*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

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


#3 oracle259

oracle259
  • Members
  • PipPipPip
  • Advanced Member
  • 119 posts

Posted 28 September 2006 - 03:54 AM

Not really...in php you can use the following code:

$match = similar_text($compare1, $compare2, $percent);
$percent = round($percent, 0);
echo $pecent;

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.


#4 BillyBoB

BillyBoB
  • Members
  • PipPipPip
  • Advanced Member
  • 630 posts

Posted 28 September 2006 - 04:09 AM

ok sorry i cant help u there i dont know




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users