Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\Parsers\MediaWikiNumberUnlocalizer Class Reference
+ Inheritance diagram for Wikibase\Repo\Parsers\MediaWikiNumberUnlocalizer:
+ Collaboration diagram for Wikibase\Repo\Parsers\MediaWikiNumberUnlocalizer:

Public Member Functions

 __construct (Language $language)
 
 unlocalizeNumber ( $number)
 
 getNumberRegex ( $delimiter='/')
 

Private Attributes

const UNLOCALIZER_MAP
 
 $language
 

Detailed Description

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Parsers\MediaWikiNumberUnlocalizer::__construct ( Language  $language)

Member Function Documentation

◆ getNumberRegex()

Wikibase\Repo\Parsers\MediaWikiNumberUnlocalizer::getNumberRegex (   $delimiter = '/')
See also
NumberUnlocalizer::getNumberRegex

Constructs a regular expression based on Language::digitTransformTable() and Language::separatorTransformTable().

Note that the resulting regex will accept scientific notation.

Parameters
string$delimiterThe regex delimiter, used for escaping.
Returns
string regular expression

◆ unlocalizeNumber()

Wikibase\Repo\Parsers\MediaWikiNumberUnlocalizer::unlocalizeNumber (   $number)
See also
NumberUnlocalizer::unlocalizeNumber
Parameters
string$numberstring to process
Returns
string unlocalized number, in a form suitable for floatval resp. intval.

Member Data Documentation

◆ $language

Wikibase\Repo\Parsers\MediaWikiNumberUnlocalizer::$language
private

◆ UNLOCALIZER_MAP

const Wikibase\Repo\Parsers\MediaWikiNumberUnlocalizer::UNLOCALIZER_MAP
private
Initial value:
= [
"\xe2\x88\x92" => '-',
"\xe2\x93\x96" => '-',
"\xe2\x93\x95" => '+',
]

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