I18N_Arabic
[ class tree: I18N_Arabic ] [ index: I18N_Arabic ] [ all elements ]

Procedural File: Normalise.php

Source Location: /Arabic/Normalise.php



Classes:

I18N_Arabic_Normalise
This class provides various functions to manipulate arabic text and normalise it by applying filters, for example, to strip tatweel and tashkeel, to normalise hamza and lamalephs, and to unshape a joined Arabic text back into its normalised form.


Page Details:

----------------------------------------------------------------------

Copyright (c) 2006-2016 Khaled Al-Sham'aa.

http://www.ar-php.org

PHP Version 5

----------------------------------------------------------------------

LICENSE

This program is open source product; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/lgpl.txt>.

----------------------------------------------------------------------

Class Name: Functions to normalise Arabic text.

Filename: Normalise.php

Original Author(s): Khaled Al-Sham'aa <khaled@ar-php.org>

Purpose: Text normalisation through various stages. Also: unshaping.

----------------------------------------------------------------------

This class provides various functions to manipulate arabic text and normalise it by applying filters, for example, to strip tatweel and tashkeel, to normalise hamza and lamalephs, and to unshape a joined Arabic text back into its normalised form.

There is also a function to reverse a utf8 string.

The functions are helpful for searching, indexing and similar functions.

Note that this class can only deal with UTF8 strings. You can use functions from the other classes to convert between encodings if necessary.

Example:

  1.      include('./I18N/Arabic.php');
  2.      $obj new I18N_Arabic('Normalise');
  3.  
  4.      $str "Arabic text with tatweel, tashkeel...";
  5.  
  6.      echo "<p><u><i>Before:</i></u><br />$str<br /><br />";
  7.  
  8.      $text $obj->stripTatweel($str);
  9.  
  10.      echo "<u><i>After:</i></u><br />$text<br /><br />";




Tags:

author:  Djihed Afifi <djihed@gmail.com>
copyright:  2006-2016 Khaled Al-Sham'aa
link:  http://www.ar-php.org
filesource:  Source Code for this file
license:  LGPL








Documentation generated on Fri, 01 Jan 2016 10:26:08 +0200 by phpDocumentor 1.4.0