Skip to content

Commit 3106ebc

Browse files
committed
Upper -> Lower
1 parent 184c673 commit 3106ebc

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

Text/Normalize.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,14 @@ class Text_Normalize
4949
const Blankchars = 1;
5050
const Symbols = 4;
5151
const Stopwords = 8;
52-
const Uppercase = 16;
52+
const Uppercase = 16; // deprecated since 1.0.5
53+
const Lowercase = 16;
5354
const Stemming = 32;
5455

5556
public $BlankcharsLang = null;
5657
public $SymbolsLang = null;
5758
public $StopwordsLang = null;
58-
public $UppercaseLang = null;
59+
public $LowercaseLang = null;
5960
public $StemmingLang = null;
6061

6162
/**
@@ -134,8 +135,8 @@ public function get($mod)
134135
if (($this->_mode & self::Stopwords) === self::Stopwords) {
135136
$this->_output = $this->_Stopwords($this->_output);
136137
}
137-
if (($this->_mode & self::Uppercase) === self::Uppercase) {
138-
$this->_output = $this->_Uppercase($this->_output);
138+
if (($this->_mode & self::Lowercase) === self::Lowercase) {
139+
$this->_output = $this->_Lowercase($this->_output);
139140
}
140141
return trim($this->_output, ' ');
141142
}
@@ -189,15 +190,15 @@ private function _Stopwords($str)
189190
}
190191
// }}}
191192

192-
// {{{ _Uppercase
193+
// {{{ _Lowercase
193194
/**
194195
* Enleve les Majuscules
195196
*
196197
* @param string $str chaine à traiter
197198
*
198199
* @return string
199200
*/
200-
private function _Uppercase($str)
201+
private function _Lowercase($str)
201202
{
202203
return strtolower($str);
203204
}

Text/NormalizeTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function tearDown()
3131
function test_uppercase()
3232
{
3333
$this->tn->set('HELLO', 'en');
34-
$ret = $this->tn->get(Text_Normalize::Uppercase);
34+
$ret = $this->tn->get(Text_Normalize::Lowercase);
3535
$this->assertEquals('hello', $ret);
3636
}
3737
function test_bankschars()
@@ -66,15 +66,15 @@ function test_stemming()
6666
function test_uppercase_bankschars()
6767
{
6868
$this->tn->set('AzErTy "\(-)=}]@^\`|[{#~ ', 'en');
69-
$ret = $this->tn->get(Text_Normalize::Uppercase | Text_Normalize::Blankchars);
69+
$ret = $this->tn->get(Text_Normalize::Lowercase | Text_Normalize::Blankchars);
7070
$this->assertEquals('azerty', $ret);
7171
}
7272
function test_full()
7373
{
7474
// '"Interpréter, c\'est appauvrir, diminuer l\'image du monde, lui substituer un monde factice de `significations`." -- [Susan Sontag]'
7575
// => interpreter appauvrir diminuer l'image du monde substituer un monde factice de signification susan sontag
7676
$this->tn->set('"Nous sommes à la fois un fluide qui se solidifie, un trésor qui s\'appauvrit, une histoire qui s\'écrit, une personnalité qui se crée." -- [Alexis Carrel]', 'fr');
77-
$ret = $this->tn->get(Text_Normalize::Uppercase | Text_Normalize::Blankchars | Text_Normalize::Symbols | Text_Normalize::Stopwords | Text_Normalize::Stemming);
77+
$ret = $this->tn->get(Text_Normalize::Lowercase | Text_Normalize::Blankchars | Text_Normalize::Symbols | Text_Normalize::Stopwords | Text_Normalize::Stemming);
7878
$this->assertEquals("nous somme a la un fluide se solidifie un tresor s'appauvrit une histoire s'ecrit une personnalite se cree alexis carrel", $ret);
7979

8080
}

package.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
<email>[email protected]</email>
1313
<active>yes</active>
1414
</lead>
15-
<date>2008-12-17</date>
15+
<date>2009-01-29</date>
1616
<version>
17-
<release>1.0.4</release>
17+
<release>1.0.5</release>
1818
<api>1.0</api>
1919
</version>
2020
<stability>
@@ -23,13 +23,13 @@
2323
</stability>
2424
<license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
2525
<notes>
26-
Ajout de SBT dans Symbols et amélioration des chargements dynamiques dans les factory
26+
Ajout d'une constante synonyme
2727
</notes>
2828
<contents>
2929
<dir name="/">
3030
<dir name="Text">
3131
<file name="Normalize.php" role="php" />
32-
<file name="NormalizeTest.php" role="test" />
32+
<file name="NormalizeTest.php" role="test" />
3333
<dir name="Normalize">
3434
<file name="Stemming.php" role="php" />
3535
<dir name="Stemming">

0 commit comments

Comments
 (0)