mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-26 13:58:55 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@78496 c90b9560-bf6c-de11-be94-00142212c4b1
55 lines
1.8 KiB
XML
55 lines
1.8 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.2 $ -->
|
|
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 -->
|
|
<refentry id="function.similar-text">
|
|
<refnamediv>
|
|
<refname>similar_text</refname>
|
|
<refpurpose>
|
|
Calculate the similarity between two strings
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>similar_text</methodname>
|
|
<methodparam><type>string</type><parameter>first</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>second</parameter></methodparam>
|
|
<methodparam choice="opt"><type>float</type><parameter>percent</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
This calculates the similarity between two strings as described
|
|
in Oliver [1993]. 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.
|
|
</para>
|
|
<para>
|
|
By passing a reference as third argument,
|
|
<function>similar_text</function> will calculate the similarity
|
|
in percent for you. It returns the number of matching chars in
|
|
both strings.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|