forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnormalizer_api.php
92 lines (78 loc) · 2.96 KB
/
normalizer_api.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
#############################################################################
# Object-oriented API
#############################################################################
/**
* Normalizer class.
*
* Normalizer provides access to Unicode normalization of strings. This class consists
* only of static methods. The iterator interface to normalizer is rarely used, so is
* not provided here.
*
* Example:
* <code>
*
* </code>
*
* @see http://www.icu-project.org/apiref/icu4c/unorm_8h.html
* @see http://www.icu-project.org/apiref/icu4c/classNormalizer.html
*
*/
class Normalizer {
#############################################################################
# Common constants.
#############################################################################
/**
* Valid normalization form values.
*
* @see Normalizer::normalize()
* @see Normalizer::isNormalize()
* @see normalizer_normalize()
* @see normalizer_is_normalized()
*/
const NONE = 1;
/** Canonical decomposition. */
const NFD = 2;
const FORM_D = NFD;
/** Compatibility decomposition. */
const NFKD = 3;
const FORM_KD = NFKD;
/** Canonical decomposition followed by canonical composition. */
const NFC = 4;
const FORM_C = NFC;
/** Compatibility decomposition followed by canonical composition. */
const NFKC =5;
const FORM_KC = NFKC;
/**
* Normalizes the input provided and returns the normalized string
* @param string $input The input string to normalize
* @param [int] $form One of the normalization forms
* @return string The normalized string or null if an error occurred.
*/
public static function normalize($input, $form = Normalizer::FORM_C) {}
/**
* Checks if the provided string is already in the specified normalization form.
* @param string $input The input string to normalize
* @param [int] $form One of the normalization forms
* @return boolean True if normalized, false otherwise or if there is an error
*/
public static function isNormalized($input, $form = Normalizer::FORM_C) {}
}
#############################################################################
# Procedural API
#############################################################################
/**
* Normalizes the input provided and returns the normalized string
* @param string $input The input string to normalize
* @param [int] $form One of the normalization forms
* @return string The normalized string or null if an error occurred.
*/
function normalizer_normalize($input, $form = Normalizer::FORM_C) {}
/**
* Checks if the provided string is already in the specified normalization form.
* @param string $input The input string to normalize
* @param [int] $form One of the normalization forms
* @return boolean True if normalized, false otherwise or if there an error
*/
function normalizer_is_normalized($input, $form = Normalizer::FORM_C) {}
?>