Skip to content

Commit 0165632

Browse files
committed
String comparison / similarity doc improvements
php/doc-en@873f4a3
1 parent 577a4aa commit 0165632

File tree

5 files changed

+61
-19
lines changed

5 files changed

+61
-19
lines changed

reference/strings/functions/levenshtein.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: a484d5d2bbad7e385a8864370b5280c4e05add8c Maintainer: hirokawa Status: ready -->
3+
<!-- EN-Revision: 873f4a3d5027bd1b584f1d1e590e22cd4a08ae84 Maintainer: hirokawa Status: ready -->
44
<!-- CREDITS: shimooka -->
55
<refentry xml:id="function.levenshtein" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
66
<refnamediv>
77
<refname>levenshtein</refname>
88
<refpurpose>二つの文字列のレーベンシュタイン距離を計算する</refpurpose>
99
</refnamediv>
10-
10+
1111
<refsect1 role="description">
1212
&reftitle.description;
1313
<methodsynopsis>
@@ -84,7 +84,7 @@
8484
</variablelist>
8585
</para>
8686
</refsect1>
87-
87+
8888
<refsect1 role="returnvalues">
8989
&reftitle.returnvalues;
9090
<para>

reference/strings/functions/metaphone.xml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: e095023e408c8cb6378ae16bb6870343a3946919 Maintainer: hirokawa Status: ready -->
3+
<!-- EN-Revision: 873f4a3d5027bd1b584f1d1e590e22cd4a08ae84 Maintainer: hirokawa Status: ready -->
44
<!-- CREDITS: shimooka,mumumu -->
55
<refentry xml:id="function.metaphone" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
77
<refname>metaphone</refname>
88
<refpurpose>文字列の metaphone キーを計算する</refpurpose>
99
</refnamediv>
10-
10+
1111
<refsect1 role="description">
1212
&reftitle.description;
1313
<methodsynopsis>
@@ -159,6 +159,16 @@ string(6) "ASTRKS"
159159
</para>
160160
</refsect1><!-- }}} -->
161161

162+
<refsect1 role="seealso">
163+
&reftitle.seealso;
164+
<para>
165+
<simplelist>
166+
<member><function>levenshtein</function></member>
167+
<member><function>similar_text</function></member>
168+
<member><function>soundex</function></member>
169+
</simplelist>
170+
</para>
171+
</refsect1>
162172
</refentry>
163173
<!-- Keep this comment at the end of the file
164174
Local variables:

reference/strings/functions/similar-text.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: e095023e408c8cb6378ae16bb6870343a3946919 Maintainer: hirokawa Status: ready -->
3+
<!-- EN-Revision: 873f4a3d5027bd1b584f1d1e590e22cd4a08ae84 Maintainer: hirokawa Status: ready -->
44
<!-- CREDITS: shimooka,mumumu -->
55
<refentry xml:id="function.similar-text" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
77
<refname>similar_text</refname>
88
<refpurpose>二つの文字列の間の類似性を計算する</refpurpose>
99
</refnamediv>
10-
10+
1111
<refsect1 role="description">
1212
&reftitle.description;
1313
<methodsynopsis>
@@ -115,6 +115,7 @@ echo "類似度: $sim ($perc %)\n";
115115
<para>
116116
<simplelist>
117117
<member><function>levenshtein</function></member>
118+
<member><function>metaphone</function></member>
118119
<member><function>soundex</function></member>
119120
</simplelist>
120121
</para>

reference/strings/functions/soundex.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 45042fef652f1b4e904e809fcbfcf31f6c60670b Maintainer: hirokawa Status: ready -->
3+
<!-- EN-Revision: 873f4a3d5027bd1b584f1d1e590e22cd4a08ae84 Maintainer: hirokawa Status: ready -->
44
<!-- CREDITS: shimooka,mumumu -->
55
<refentry xml:id="function.soundex" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
77
<refname>soundex</refname>
88
<refpurpose>文字列の soundex キーを計算する</refpurpose>
99
</refnamediv>
10-
10+
1111
<refsect1 role="description">
1212
&reftitle.description;
1313
<methodsynopsis>

reference/strings/functions/strcmp.xml

Lines changed: 41 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- $Revision$ -->
3-
<!-- EN-Revision: 9b68bf2b63200534e022bc65e800cae6c75abf26 Maintainer: hirokawa Status: ready -->
3+
<!-- EN-Revision: 873f4a3d5027bd1b584f1d1e590e22cd4a08ae84 Maintainer: hirokawa Status: ready -->
44
<!-- CREDITS: shimooka -->
55
<refentry xml:id="function.strcmp" xmlns="http://docbook.org/ns/docbook">
66
<refnamediv>
77
<refname>strcmp</refname>
88
<refpurpose>バイナリセーフな文字列比較</refpurpose>
99
</refnamediv>
10-
10+
1111
<refsect1 role="description">
1212
&reftitle.description;
1313
<methodsynopsis>
@@ -17,6 +17,16 @@
1717
</methodsynopsis>
1818
<simpara>
1919
この比較は大文字小文字を区別することに注意してください。
20+
大文字小文字を区別しない比較をする場合は、
21+
<function>strcasecmp</function>
22+
を参照ください。
23+
</simpara>
24+
<simpara>
25+
この比較はロケールを認識しないことに注意してください。
26+
ロケールを考慮した比較をする場合は、
27+
<function>strcoll</function> または
28+
<methodname>Collator::compare</methodname>
29+
を参照ください。
2030
</simpara>
2131
</refsect1>
2232

@@ -86,17 +96,38 @@ if (strcmp($var1, $var2) !== 0) {
8696
</para>
8797
</refsect1>
8898

99+
89100
<refsect1 role="seealso">
90101
&reftitle.seealso;
91102
<para>
92-
<simplelist>
93-
<member><function>strcasecmp</function></member>
94-
<member><function>preg_match</function></member>
95-
<member><function>substr_compare</function></member>
96-
<member><function>strncmp</function></member>
97-
<member><function>strstr</function></member>
98-
<member><function>substr</function></member>
99-
</simplelist>
103+
<itemizedlist>
104+
<listitem>
105+
<simpara>文字列の完全な比較</simpara>
106+
<simplelist>
107+
<member><function>strcasecmp</function></member>
108+
<member><methodname>Collator::compare</methodname></member>
109+
<member><function>strcoll</function></member>
110+
</simplelist>
111+
</listitem>
112+
<listitem>
113+
<simpara>文字列の部分比較</simpara>
114+
<simplelist>
115+
<member><function>substr_compare</function></member>
116+
<member><function>strncmp</function></member>
117+
<member><function>strstr</function></member>
118+
</simplelist>
119+
</listitem>
120+
<listitem>
121+
<simpara>文字列の類似度 / その他の文字列比較</simpara>
122+
<simplelist>
123+
<member><function>preg_match</function></member>
124+
<member><function>levenshtein</function></member>
125+
<member><function>metaphone</function></member>
126+
<member><function>similar_text</function></member>
127+
<member><function>soundex</function></member>
128+
</simplelist>
129+
</listitem>
130+
</itemizedlist>
100131
</para>
101132
</refsect1>
102133

0 commit comments

Comments
 (0)