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

Class: ArWordTag

Source Location: /sub/ArWordTag.class.php

Class Overview


This PHP class to tagging Arabic Word


Author(s):

Copyright:

  • 2009 Khaled Al-Shamaa

Variables

Methods



Class Details

[line 119]
This PHP class to tagging Arabic Word



Tags:

author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
copyright:  2009 Khaled Al-Shamaa
link:  http://www.ar-php.org
license:  LGPL


[ Top ]


Class Variables

static $_normalizeAlef = array('أ','إ','آ')

[line 122]



Tags:

access:  protected

Type:   mixed


[ Top ]

static $_normalizeDiacritics = array('َ','ً','ُ','ٌ','ِ','ٍ','ْ','ّ')

[line 123]



Tags:

access:  protected

Type:   mixed


[ Top ]

static $_particle_pre_nouns = array('عن', 'في', 'مذ', 'منذ', 'من', 'الى', 'على', 'حتى', 'الا', 'غير', 'سوى', 'خلا', 'عدا', 'حاشا', 'ليس')

[line 121]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


static method highlightText [line 287]

static string highlightText( string $str, [string $style = null], [string $inputCharset = null], [string $outputCharset = null], [object $main = null])

Highlighted all nouns in a given Arabic string



Tags:

return:  Arabic string in HTML format where all nouns highlighted
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


Parameters:

string   $str   Arabic string you want to highlighted all its nouns
string   $style   Name of the CSS class you would like to apply
string   $inputCharset   (optional) Input charset [utf-8|windows-1256|iso-8859-6] default value is NULL (use set input charset)
string   $outputCharset   (optional) Output charset [utf-8|windows-1256|iso-8859-6] default value is NULL (use set output charset)
object   $main   Main Ar-PHP object to access charset converter options

[ Top ]

static method isNoun [line 137]

static boolean isNoun( string $word, string $word_befor, [string $inputCharset = null], [object $main = null])

Check if given rabic word is noun or not



Tags:

return:  TRUE if given word is Arabic noun
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


Parameters:

string   $word   Word you want to check if it is noun (windows-1256)
string   $word_befor   The word before word you want to check
string   $inputCharset   (optional) Input charset [utf-8|windows-1256|iso-8859-6] default value is NULL (use set input charset)
object   $main   Main Ar-PHP object to access charset converter options

[ Top ]

static method tagText [line 236]

static array tagText( string $str, [string $inputCharset = null], [string $outputCharset = null], [object $main = null])

Tag all words in a given Arabic string if they are nouns or not



Tags:

return:  Two dimension array where item[i][0] represent the word i in the given string, and item[i][1] is 1 if that word is noun and 0 if it is not
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


Parameters:

string   $str   Arabic string you want to tag all its words
string   $inputCharset   (optional) Input charset [utf-8|windows-1256|iso-8859-6] default value is NULL (use set input charset)
string   $outputCharset   (optional) Output charset [utf-8|windows-1256|iso-8859-6] default value is NULL (use set output charset)
object   $main   Main Ar-PHP object to access charset converter options

[ Top ]


Documentation generated on Fri, 12 Mar 2010 01:01:44 +0300 by phpDocumentor 1.4.0