equivset
Visually Equivalent Set of UTF-8 Characters
Loading...
Searching...
No Matches
Wikimedia\Equivset\Equivset Class Reference

Default Equivset. More...

+ Inheritance diagram for Wikimedia\Equivset\Equivset:
+ Collaboration diagram for Wikimedia\Equivset\Equivset:

Public Member Functions

 __construct (array $data=[], string $dataPath='')
 
 all ()
 {Gets the equivset.
Returns
array An associative array of equivalent characters.
}
 
 normalize (string $value)
 {Normalize a string.
Parameters
string$valueThe string to normalize against the equivset.
Returns
string
}
 
 isEqual (string $str1, string $str2)
 {Determine if the two strings are visually equal.
Parameters
string$str1The first string.
string$str2The second string.
Returns
bool
}
 
 has (string $key)
 {Determine if an equivalent character exists.
Parameters
string$keyThe character that was used.
Returns
bool If the character has an equivalent.
}
 
 get (string $key)
 {Get an equivalent character.
Parameters
string$keyThe character that was used.
Returns
string The equivalent character.
Exceptions
LogicExceptionIf character does not exist.
}
 
 getIterator ()
 {}
 

Protected Member Functions

 load ()
 Get the equivset.
 

Protected Attributes

array $data
 
string $dataPath
 

Detailed Description

Default Equivset.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Equivset\Equivset::__construct ( array $data = [],
string $dataPath = '' )
Parameters
array<string,string>$data Equivalent Set
string$dataPathPath of the equivset array.

Member Function Documentation

◆ all()

Wikimedia\Equivset\Equivset::all ( )

{Gets the equivset.

Returns
array An associative array of equivalent characters.
}

Implements Wikimedia\Equivset\EquivsetInterface.

◆ get()

Wikimedia\Equivset\Equivset::get ( string $key)

{Get an equivalent character.

Parameters
string$keyThe character that was used.
Returns
string The equivalent character.
Exceptions
LogicExceptionIf character does not exist.
}

Implements Wikimedia\Equivset\EquivsetInterface.

◆ has()

Wikimedia\Equivset\Equivset::has ( string $key)

{Determine if an equivalent character exists.

Parameters
string$keyThe character that was used.
Returns
bool If the character has an equivalent.
}

Implements Wikimedia\Equivset\EquivsetInterface.

◆ isEqual()

Wikimedia\Equivset\Equivset::isEqual ( string $str1,
string $str2 )

{Determine if the two strings are visually equal.

Parameters
string$str1The first string.
string$str2The second string.
Returns
bool
}

Implements Wikimedia\Equivset\EquivsetInterface.

◆ load()

Wikimedia\Equivset\Equivset::load ( )
protected

Get the equivset.

Returns
array<string,string> An associative array of equivalent characters.

◆ normalize()

Wikimedia\Equivset\Equivset::normalize ( string $value)

{Normalize a string.

Parameters
string$valueThe string to normalize against the equivset.
Returns
string
}

Implements Wikimedia\Equivset\EquivsetInterface.


The documentation for this class was generated from the following file: