Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

String similarity

Name: Anonymous 2010-09-08 4:41

PHP has a function that does it. How would I implement it? Considering string shifting and single character differences, that's a lot of cases to go through.

Name: Anonymous 2010-09-08 5:00

Name: Anonymous 2010-09-08 10:18

PHP

Name: Anonymous 2010-09-08 11:45

>>3
I didn't notice so I was going to actually HELP HIM!!!.

Name: Anonymous 2010-09-08 12:34

>>2
This does not handle a single-character shift well.

Name: Anonymous 2010-09-08 13:16

>>5
That's not true.

Name: Anonymous 2010-09-08 14:02

Some people, when confronted with a problem like "Compute the similarity of two strings" will think: Hey, I know, I'll just ask /prog/!

Now they have three problems.

Name: Anonymous 2010-09-08 16:58

What's wrong with PHP?

Name: Anonymous 2010-09-08 17:08

>>8
What's right with PHP?

Name: Anonymous 2010-09-08 17:30

>>9
It's C with a scripting language's type flexibility.

Name: Anonymous 2010-09-08 17:42


function similarity($a, $b) {
  $similarity = 0;
  for ($i=0; i < strlen($a); $i++) {
    if ($a[$i] == $b[$i])
      similarity++;
    else
      similarity--;
  }
  return $similiarity / strlen($a);
}

Name: Anonymous 2010-09-08 17:50

>>11
'>nigger cant into PHP

Name: Anonymous 2010-09-08 19:34

*African American

Name: Anonymous 2010-09-09 1:51

>>13
'>nigger cant into African American?

Name: Anonymous 2010-09-09 5:11

>>14
then he should have went to college Terrible! back to /b/ please

Name: Anonymous 2010-09-09 9:08

Fuck off, ``faggot''.

Name: Anonymous 2010-09-09 11:36

>>15
should have went
IHBT

Name: Anonymous 2010-09-09 12:30

>>17
Yeah, everybody knows it's ``should of''.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List