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

Class: Text_TeXHyphen_PatternDB_ObjectHash

Source Location: /Text_TeXHyphen-0.1.0/Text/TeXHyphen/PatternDB/objecthash.php

Class Overview

Text_TeXHyphen_PatternDB
   |
   --Text_TeXHyphen_PatternDB_ObjectHash

A Text_TeXHyphen_Pattern object hash class for the TeX hyphenation algorithm.


Author(s):

Version:

  • $Id$

Methods


Inherited Variables

Inherited Methods

Class: Text_TeXHyphen_PatternDB

Text_TeXHyphen_PatternDB::Text_TeXHyphen_PatternDB()
Constructor of a Text_TeXHyphen_PatternDB object.
Text_TeXHyphen_PatternDB::factory()
Factory for creating a pattern database.
Text_TeXHyphen_PatternDB::getPattern()
Gets the Text_TeXHyphen_Pattern object specified by the $key, if it exists in the pattern database.

Class Details

[line 39]
A Text_TeXHyphen_Pattern object hash class for the TeX hyphenation algorithm.


[ Top ]


Method Detail

factory   [line 78]

Text_TeXHyphen_PatternDB_ObjectHash|false &factory( string $type, [array $options = array()])

Factory for creating a Text_TeXHyphen_Pattern object hash as pattern database.

The type have to be 'objecthash', otherwise false will returned. For the creation extists two modes (options['mode']):

  • build, creates a whole new hash from an array of TeX pattern strings. For the initialize function the option 'onlyKeys' and 'sort' can be passed.
  • load, loads a serialized hash from a file specified by the option 'fileName'. Additional the option 'compression' for the unserialize() can be passed.

  • Return: Reference to a object of type Text_TeXHyphen_PatternDB_ObjectHash, a subclass of Text_TeXHyphen_PatternDB, or false on error.
  • Access: public

Overrides Text_TeXHyphen_PatternDB::factory() (Factory for creating a pattern database.)

Parameters:

string   $type   —  Name of the pattern database implementation, must 'objecthash'.
array   $options   —  Options for the pattern retrieving.

[ Top ]

getPattern   [line 208]

Text_TeXHyphen_Pattern|false &getPattern( string $key)

Gets the Text_TeXHyphen_Pattern object specified by the $key, if it exists in the pattern database.
  • Return: Reference to a Text_TeXHyphen_Pattern object if successful or false if the pattern isn't found.
  • See: Text_TeXHyphen_Pattern
  • Access: public

Overrides Text_TeXHyphen_PatternDB::getPattern() (Gets the Text_TeXHyphen_Pattern object specified by the $key, if it exists in the pattern database.)

Parameters:

string   $key   —  String by which the pattern should be identified in the hash.

[ Top ]

initialize   [line 258]

boolean initialize( array $patternStrArr, [boolean $onlyKeys = false], [boolean $sort = true])

Initializes the Text_TeXHyphen_Pattern object hash.

The $patternStrArr contains the TeX pattern strings from which the Text_TeXHyphen_Pattern will created. If $onlyKey is true, only the key of the pattern is created and the TeX pattern string is included in the hash. The Text_TeXHyphen_Pattern will created on demand by getPattern(). If $sort is true the hash will after initilization sorted by ksort().


Parameters:

array   $patternStrArr   —  Array of TeX pattern strings.
boolean   $onlyKeys   —  Decides, if only the patterns keys are generated and the Text_TeXHyphen_Pattern on demand.
boolean   $sort   —  Decides, if the hash is sorted at the end of the initialization process.

[ Top ]

serialize   [line 342]

string|false serialize( [boolean $compression = true])

Serializes the current state of the pattern hash and returns the data.

Takes the current pattern hash and passes to serialize(). The returned string, will compressed by gzcompress(), if $compression is true. If the $onlyKeys=true option of the inizialize function is used the missing Text_TeXHyphen_Pattern object will not created before serialization.


Parameters:

boolean   $compression   —  Decides, if the serialized hash is compressed.

[ Top ]

unserialize   [line 377]

boolean unserialize( string $data, [boolean $compression = true])

Unserializes the pattern hash from the data.

Takes the $data and uncompresses the serialized pattern hash, if $compression is true. The serialized pattern hash will passed to unserialize() and the pattern hash set to the returned array.

  • Return: true, if successful otherwise false.
  • Access: public

Parameters:

string   $data   —  (compressed) serialzed hash data.
boolean   $compression   —  Decides, if the data is uncompressed before unserialisation of the data.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 13:51:35 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.