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

Class: Text_TeXHyphen_Pattern

Source Location: /Text_TeXHyphen-0.1.0/Text/TeXHyphen/Pattern.php

Class Overview


The pattern class for the TeX hyphenation algorithm.


Author(s):

Version:

  • $Id$

Methods


Inherited Variables

Inherited Methods


Class Details

[line 31]
The pattern class for the TeX hyphenation algorithm.


[ Top ]


Method Detail

createHyphenValues   [line 283]

array|false createHyphenValues( string $patternStr)

Creates the hyphen values from a TeX pattern string.

The hyphen values are an array of intergers, which values the desireability of a hyphen between two characters.

  • Return: Array of integer or false, if the TeX pattern string contains only of whitespace characters.
  • Access: public

Parameters:

string   $patternStr   —  TeX pattern string

[ Top ]

createKey   [line 236]

string|false createKey( string $patternStr)

Creates the key from a TeX pattern string

The key contains only of the characters and dots of the TeX pattern string. False will return, if the resulting key contains only of whitespace characters.

  • Return: the key of the TeX pattern string or false, if the created key contains only of whitespace characters.
  • Access: public

Parameters:

string   $patternStr   —  TeX pattern string.

[ Top ]

factory   [line 105]

Text_TeXHyphen_Pattern|false &factory( string $patternStr)

Factory for creating a Text_TeXHyphen_Pattern object from a TeX pattern string.

The factory initalizes a new Text_TeXHyphen_Pattern object, creates the key and the hyphen values. If the pattern string didn't meet the criterias of isValid(), false will returned. This also occurs, if the creation of the key or the hyphen values return an error.


Parameters:

string   $patternStr   —  TeX pattern string.

[ Top ]

getHyphenValue   [line 336]

integer|false getHyphenValue( integer $index)

Gets the hyphen value at a passed index.

False will return, if the hyphen value isn't set or the value isn't an integer.

  • Return: the value at the index in the hyphen values or false, if the hyphen values are invalid or the index isn't available.
  • Access: public

Parameters:

integer   $index   —  Index of the value.

[ Top ]

getHyphenValues   [line 314]

array|false getHyphenValues( )

Gets the hyphen values of the pattern.
  • Return: Array of integers or false, if the hyphen values is empty or not an array.
  • Access: public

[ Top ]

getKey   [line 262]

string|false getKey( )

Gets the key of the pattern.

If the key contains only of whitspace characters false will returned.

  • Return: the key by which the pattern can be identified or false, if the key contains only of whitespace characters.
  • Access: public

[ Top ]

getPattern   [line 213]

string|false getPattern( )

Gets the TeX pattern string.
  • Return: the TeX pattern string or false, if the pattern string contains only of whitespace characters.
  • Access: public

[ Top ]

isValid   [line 137]

boolean isValid( string $patternStr)

Validates a pattern string against some special criterias.

The pattern string have to meet following criterias:

  • not empty
  • not only a combination of whitepace charaters, digits or dots
  • no whitespace character at all
  • no dots inside the string
All other validation for a correct pattern string have to take place outside the class. This decision was made, because different languages could have different characters allowed in pattern strings.

  • Return: true, if valid otherwise false
  • Access: public

Parameters:

string   $patternStr   —  TeX pattern string.

[ Top ]

setPattern   [line 181]

boolean setPattern( string $patternStr)

Sets the TeX pattern string.

Whitespace charaters at the start and end will trimed. The key and hyphen values are created automatic. False will returned, if the pattern string is invalid or the key and hyphen values creation fail, otherwise true.

  • Return: true, if pattern string is valid, the key and the hyphen values could created otherwise false.
  • Access: public

Parameters:

string   $patternStr   —  TeX pattern string.

[ Top ]


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