Test Ar-PHP Functionality Online
Test PHP Function
Sub Class:
- Select one -
AutoSummarize
CharsetD
CompressStr
Date
Gender
Glyphs
Hiero
Identifier
KeySwap
Mktime
Normalise
Numbers
Query
Salat
Sort
Soundex
Standard
Stemmer
StrToTime
Transliteration
WordTag
Method:
- Select one -
isNoun
tagText
highlightText
str:
Result (
var_dump
output):
Ar-PHP Manual
static method tagText
[line
290
]
static array tagText( string $str)
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-Sham'aa <
khaled@ar-php.org
>
access:
public
Parameters:
string
$str
Arabic string you want to tag all its words
Example
include
(
'./I18N/Arabic.php'
)
;
$obj
=
new
I18N_Arabic
(
'WordTag'
)
;
$hStr
=
$obj
->
highlightText
(
$str
,
'#80B020'
)
;
echo
$str
.
'<hr />'
.
$hStr
.
'<hr />'
;
$taggedText
=
$obj
->
tagText
(
$str
)
;
foreach
(
$taggedText
as
$wordTag
)
{
list
(
$word
,
$tag
)
=
$wordTag
;
if
(
$tag
==
1
)
{
echo
"
<font color=#DBEC21>
$word
is Noun</font>,
"
;
}
if
(
$tag
==
0
)
{
echo
"
$word
is not Noun,
"
;
}
}
Popular
utf8Glyphs
(1224)
ar2en
(973)
money2str
(550)
en2ar
(400)
isFemale
(291)
Recent
stripTatweel
(23 hours)
stem
(23 hours)
tagText
(1 days)
swapAe
(8 days)
normaliseHamza
(8 days)
Links
Homepage
Download
Bug Report
Feature Request
My Blog
My Twitter
Ads!
Home
|
Twitter
|
Blog
|
Contact
Copyright © 2006 - 2016 Khaled Al-Sham'aa