diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
---|---|---|
committer | <> | 2013-04-03 16:25:08 +0000 |
commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /ext/intl/doc/normalizer_api.php | |
download | php2-master.tar.gz |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/intl/doc/normalizer_api.php')
-rw-r--r-- | ext/intl/doc/normalizer_api.php | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/ext/intl/doc/normalizer_api.php b/ext/intl/doc/normalizer_api.php new file mode 100644 index 0000000..a9bb566 --- /dev/null +++ b/ext/intl/doc/normalizer_api.php @@ -0,0 +1,92 @@ +<?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) {} + + +?> + + |