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

Class: ArCompressStr

Source Location: /sub/ArCompressStr.class.php

Class Overview


This PHP class compress Arabic string using Huffman-like coding


Author(s):

Copyright:

  • 2009 Khaled Al-Shamaa

Variables

Methods



Class Details

[line 125]
This PHP class compress Arabic string using Huffman-like coding



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 $_bin =  '0000|0001|0010|0011|0100|0101|0110|0111|1000|1001|1010|1011|1100|1101|1110|1111|'

[line 131]



Tags:

access:  protected

Type:   mixed


[ Top ]

static $_binary =  '0000|0001|0010|0011|0100|0101|0110|0111|'

[line 128]



Tags:

access:  protected

Type:   mixed


[ Top ]

static $_encode =  ' الميوتة'

[line 127]



Tags:

access:  protected

Type:   mixed


[ Top ]

static $_hex =  '0123456789abcdef'

[line 130]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


static method compress [line 180]

static binary compress( string $str, [string $inputCharset = null], [object $main = null])

Compress the given string using the Huffman-like coding



Tags:

return:  The compressed string in binary format
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


Parameters:

string   $str   The text to compress
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 decompress [line 205]

static string decompress( binary $bin, [string $outputCharset = null], [object $main = null])

Uncompress a compressed string



Tags:

return:  The original uncompressed string
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


Parameters:

binary   $bin   The text compressed by compress().
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 length [line 261]

static integer length( binary $bin)

Retrieve the origenal string length



Tags:

return:  Origenal string length
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


Parameters:

binary   $bin   Compressed binary string

[ Top ]

static method search [line 233]

static boolean search( binary $bin, string $word, [string $inputCharset = null], [object $main = null])

Search a compressed string for a given word



Tags:

return:  True if found and False if not found
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


Parameters:

binary   $bin   Compressed binary string
string   $word   The string you looking for
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 setLang [line 142]

static boolean setLang( string $lang)

Set required _encode and _decode hash of most probably character in selected language



Tags:

return:  TRUE
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


Parameters:

string   $lang   [en, fr, gr, it, sp, ar] Language profile selected

[ Top ]

static method _bits2hex [line 362]

static hexadecimal _bits2hex( binary $bits)

Convert binary string into hexadecimal string



Tags:

return:  The hexadecimal representation of binary string
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  protected


Parameters:

binary   $bits   The binary string to convert

[ Top ]

static method _bits2str [line 324]

static string _bits2str( binary $bits)

Convert binary string into textual string



Tags:

return:  The textual representation of binary string
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  protected


Parameters:

binary   $bits   The binary string to convert

[ Top ]

static method _hex2bits [line 385]

static binary _hex2bits( hexadecimal $hex)

Convert hexadecimal string into binary string



Tags:

return:  The binary representation of hexadecimal string
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  protected


Parameters:

hexadecimal   $hex   The hexadezimal string to convert

[ Top ]

static method _str2bits [line 290]

static binary _str2bits( string $str)

Convert textual string into binary string



Tags:

return:  The binary representation of textual string
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  protected


Parameters:

string   $str   The textual string to convert

[ Top ]


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