Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

similar_text(3) [php man page]

SIMILAR_TEXT(3) 							 1							   SIMILAR_TEXT(3)

similar_text - Calculate the similarity between two strings

SYNOPSIS
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 string

SYNOPSIS
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)
Man Page

14 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Redirection Question

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)
Discussion started by: snag49ers
2 Replies

2. Shell Programming and Scripting

Perl & Sed command -- Out of Memory Error

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)
Discussion started by: srivijay81
3 Replies

3. Shell Programming and Scripting

Insert ongoing numeration in each line?

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)
Discussion started by: Bloomy
12 Replies

4. Shell Programming and Scripting

Add new line before specific character

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)
Discussion started by: attila
4 Replies

5. Shell Programming and Scripting

finding matches between multiple files from different directories

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)
Discussion started by: bramya07
0 Replies

6. Shell Programming and Scripting

Text Format

I'd like to format a text in unix before mailing it to users. I want to change color and font of my plain text in unix. Thanks.. (1 Reply)
Discussion started by: Sara_84
1 Replies

7. Shell Programming and Scripting

Formatting file data to another file (control character related)

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)
Discussion started by: hk6279
3 Replies

8. Shell Programming and Scripting

Maybe by AWK: printing help diagonal matrix characters into line

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)
Discussion started by: rveri
9 Replies

9. Shell Programming and Scripting

Obtain the names of the flanking regions

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)
Discussion started by: anurupa777
1 Replies

10. Shell Programming and Scripting

[Solved] FOR loop / IF statement returning error

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)
Discussion started by: jfxdavies
5 Replies

11. IP Networking

TXT Records: Usage

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)
Discussion started by: Lost in Cyberia
1 Replies

12. AIX

SSH connection "Permission denied"

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)
Discussion started by: moudmm
7 Replies

13. Shell Programming and Scripting

Gathering data in columns from multiple files

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)
Discussion started by: user10600
5 Replies

14. Shell Programming and Scripting

Unable to identify the special characters beyond the range of "[\x80-\xFF]"

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)
Discussion started by: Abhijit Sen
14 Replies