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

Class: Text_TeXHyphen_WordCache_SimpleHash

Source Location: /Text_TeXHyphen-0.1.0/Text/TeXHyphen/WordCache/simplehash.php

Class Overview

Text_TeXHyphen_WordCache
   |
   --Text_TeXHyphen_WordCache_SimpleHash

A simple hash class as word cache for the TeX hyphenation algorithm.


Author(s):

Version:

  • $Id$

Methods


Inherited Variables

Inherited Methods

Class: Text_TeXHyphen_WordCache

Text_TeXHyphen_WordCache::Text_TeXHyphen_WordCache()
Constructor of a Text_TeXHyphen_WordCache object.
Text_TeXHyphen_WordCache::add()
Adds a word and its syllables to the cache.
Text_TeXHyphen_WordCache::factory()
Factory for creating a word.
Text_TeXHyphen_WordCache::getSyllables()
Gets the syllables of a word, if found in cache.

Class Details

[line 37]
A simple hash class as word cache for the TeX hyphenation algorithm.


[ Top ]


Method Detail

add   [line 117]

boolean add( string $word, array $syls)

Adds a word and its syllables to the cache.
  • Return: true, if the $word could added to the cache otherwise false.

Overrides Text_TeXHyphen_WordCache::add() (Adds a word and its syllables to the cache.)

Parameters:

string   $word   —  Word, which syllables should stored.
array   $syls   —  Array of strings, which contains of the syllables of the $word.

[ Top ]

factory   [line 63]

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

Factory for creating a word.
  • Return: Reference to a object of type Text_TeXHyphen_WordCache_SimpleHash, a subclass of Text_TeXHyphen_WordCache, or false on error.
  • Access: public

Overrides Text_TeXHyphen_WordCache::factory() (Factory for creating a word.)

Parameters:

string   $type   —  Name of the word cache implementation, must 'simplehash'.
array   $options   —  Options for the word cache.

[ Top ]

getSyllables   [line 92]

array|false getSyllables( string $word)

Gets the syllables of a word, if found in cache.
  • Return: Array of string or false, if $word isn't found.
  • Access: public

Overrides Text_TeXHyphen_WordCache::getSyllables() (Gets the syllables of a word, if found in cache.)

Parameters:

string   $word   —  Word of which the syllables should got.

[ Top ]

serialize   [line 142]

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

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

Takes the current hash and passes to serialize(). The returned string, will compressed by gzcompress(), if $compression is true.

  • Return: the (compressed) serialized hash data or false on error.
  • Access: public

Parameters:

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

[ Top ]

unserialize   [line 176]

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

Unserializes the hash from the data.

Takes the $data and uncompresses the serialized hash, if $compression is true. The serialized hash will passed to unserialize() and the 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.