SIMILAR_TEXT(3) 1 SIMILAR_TEXT(3)similar_text - Calculate the similarity between two stringsSYNOPSIS
int similar_text (string $first, string $second, [float &$percent])
DESCRIPTION
This calculates the similarity between two strings as described in Programming Classics: Implementing the World's Best Algorithms by
Oliver (ISBN 0-131-00413-1). Note that this implementation does not use a stack as in Oliver's pseudo code, but recursive calls which may
or may not speed up the whole process. Note also that the complexity of this algorithm is O(N**3) where N is the length of the longest
string.
PARAMETERS
o $first
- The first string.
o $second
- The second string.
o $percent
- By passing a reference as third argument, similar_text(3) will calculate the similarity in percent for you.
RETURN VALUES
Returns the number of matching chars in both strings.
SEE ALSO levenshtein(3), soundex(3).
PHP Documentation Group SIMILAR_TEXT(3)
Check Out this Related Man Page
SOUNDEX(3) 1 SOUNDEX(3)soundex - Calculate the soundex key of a stringSYNOPSIS
string soundex (string $str)
DESCRIPTION
Calculates the soundex key of $str.
Soundex keys have the property that words pronounced similarly produce the same soundex key, and can thus be used to simplify searches in
databases where you know the pronunciation but not the spelling. This soundex function returns a string 4 characters long, starting with a
letter.
This particular soundex function is one described by Donald Knuth in "The Art Of Computer Programming, vol. 3: Sorting And Searching",
Addison-Wesley (1973), pp. 391-392.
PARAMETERS
o $str
- The input string.
RETURN VALUES
Returns the soundex key as a string.
EXAMPLES
Example #1
Soundex Examples
<?php
soundex("Euler") == soundex("Ellery"); // E460
soundex("Gauss") == soundex("Ghosh"); // G200
soundex("Hilbert") == soundex("Heilbronn"); // H416
soundex("Knuth") == soundex("Kant"); // K530
soundex("Lloyd") == soundex("Ladd"); // L300
soundex("Lukasiewicz") == soundex("Lissajous"); // L222
?>
SEE ALSO levenshtein(3), metaphone(3), similar_text(3).
PHP Documentation Group SOUNDEX(3)
I just wondered if I'm understanding this command line correctly
cat 2>save1 0<memo | sort 2>save2 1>letter
This means that stdin will read from memo and if there is an error then stderr will write to save1. Am I correct in saying that the sort command will sort the memo file and write... (2 Replies)
Experts,
We used to receive our source files with '~^' as row delimiter. This file contains 2500K records and two of the columns having value in HTML formats within the file.
While running the below commands against the file, we are encountering out of memory, could you please help to... (3 Replies)
Hi.
I have a text file with lines like this:
( chp_testfile_0065 "Blablabla." )
( chp_testfile_0003 "Blablabla" )
( chp_testfile_0123 "Blablabla" )
I need one more 0 in each line, so that I have 5 digits in a sequence. I also need an ongoing numeration from 1 to n, so that
(... (12 Replies)
hello all,
I have file like this "infile.txt" (all data in one line)
A240 582247.99974288.7 8.0 239 582248.19974301.1 8.0 238 582248.39974313.6 8.01A 237 582248.49974326.1 8.0 236 582248.69974338.6 8.0 235 582248.79974351.1 8.01A 234 582248.99974363.5 8.0 233 582249.19974376.0 8.0 232... (4 Replies)
Hi all...
Can somebody pls help me with this...
I have a directory (dir1) which has many subdirectories(vr001,vr002,vr003..) with each subdir containing similar text file(say ras.txt).
I have another directory(dir2) which has again got some subdir(vr001c,vr002c,vr003c..) with each subdir... (0 Replies)
I have to write a program to read data from files and then format into another file. However, I face a strange problem related to control character that I can't understand and solve.
The source file is compose of many lines with such format:
T_NAME|P_NAME|P_CODE|DOCUMENT_PATH|REG_DATE
... (3 Replies)
Hi Experts,
I want to print this charts diagonal data into straight lines.
This is a matrix 24X24 Horizontal and vertical.
- I want to print all the diagonal cutting characters into straight line:
Data:
E F S S A H A L L A T M C N O T S O B O D U Q H
I W I B N L O C N I L N L A N S I N... (9 Replies)
Hi I have 2 files; usually the end position in the file1 is the start position in the file2 and the end position in file2 will be the start position in file1 (flanks)
file1
Id start end
aaa1 0 3000070
aaa1 3095270 3095341
aaa1 3100822 3100894
aaa1 ... (1 Reply)
The code at the bottom is a simplified example of what we have.
If I use the following:
&& echo "echo failed"
$? returns 1
When I use
if ; then echo "echo failed" ; fi
$? returns 0
Does anyone know what's wrong with this?
Using AIX 6.1 and KSH
for NUM in 1 2 3
do
... (5 Replies)
Ok..the last DNS question. I've been on a DNS kick lately. So when poking around, I keep bumping sites that have txt records all with cryptic, but yet similar text in them.. Something like:
cnn.com. 3305 IN TXT "882269757-4422010"
cnn.com. 3305 IN TXT "ms=ms97284866"... (1 Reply)
Hello,
I tried to connect with root or any other user to AIX using ssh. It throws me error like Permission denied (publickey,keyboard-interactive). i don't know why!!
and the PermitRootLogin is yes
any help will be appreciated
Thanks (7 Replies)
Hello world!
I need to gather all the data from different folders and copy it in an one unique text file in columns format.
Let me explain, letīs say "a, b, c" are 3 data files of thousands and thousands lines (in the reality, I have nearly one hundred).
"a, b, c" are located in the folders... (5 Replies)
I want to filter out the special character whose ascii value doesn't fall within the range "" .
Example:� or Ć. So in that case is there any defined range which will filter out this characters.
I can filter those which falls withing "" . Need to filter those special chracter which doesn't... (14 Replies)