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:

  • 2006-2010 Khaled Al-Shamaa

Variables

Methods



Class Details

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



Tags:

author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
copyright:  2006-2010 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 136]



Tags:

access:  protected

Type:   mixed


[ Top ]

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

[line 133]



Tags:

access:  protected

Type:   mixed


[ Top ]

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

[line 132]



Tags:

access:  protected

Type:   mixed


[ Top ]

static $hex =  '0123456789abcdef'

[line 135]



Tags:

access:  protected

Type:   mixed


[ Top ]

$compressInput =  'windows-1256'

[line 143]

"compress" method input charset



Tags:

access:  public

Type:   String


[ Top ]

$compressVars = array('str')

[line 149]

Name of the textual "compress" method parameters



Tags:

access:  public

Type:   Array


[ Top ]

$decompressOutput =  'windows-1256'

[line 155]

"decompress" method output charset



Tags:

access:  public

Type:   String


[ Top ]

$searchInput =  'windows-1256'

[line 161]

"search" method input charset



Tags:

access:  public

Type:   String


[ Top ]

$searchVars = array('word')

[line 167]

Name of the textual "search" method parameters



Tags:

access:  public

Type:   Array


[ Top ]



Class Methods


static method bits2hex [line 381]

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 343]

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 compress [line 220]

static binary compress( string $str)

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

[ Top ]

static method decompress [line 237]

static string decompress( binary $bin)

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().

[ Top ]

static method hex2bits [line 404]

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 length [line 280]

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 257]

static boolean search( binary $bin, string $word)

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

[ Top ]

static method setLang [line 185]

static object setLang( string $lang)

Set required encode and binary hash of most probably character in selected language



Tags:

return:  to build a fluent interface
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 str2bits [line 309]

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 ]

constructor __construct [line 172]

ArCompressStr __construct( )

Loads initialize values



Tags:

access:  public


[ Top ]


Documentation generated on Sat, 14 Aug 2010 13:23:54 -0700 by phpDocumentor 1.4.0