Page MenuHomePhabricator

D18648.diff
No OneTemporary

D18648.diff

diff --git a/src/search/PhutilSearchStemmer.php b/src/search/PhutilSearchStemmer.php
--- a/src/search/PhutilSearchStemmer.php
+++ b/src/search/PhutilSearchStemmer.php
@@ -9,6 +9,7 @@
}
public function stemCorpus($corpus) {
+ $corpus = $this->normalizeCorpus($corpus);
$tokens = preg_split('/[^a-zA-Z0-9\x7F-\xFF._]+/', $corpus);
$words = array();
@@ -19,13 +20,12 @@
continue;
}
- $normal_word = $this->normalizeToken($token);
- $words[$normal_word] = $normal_word;
+ $words[$token] = $token;
}
$stems = array();
- foreach ($words as $normal_word) {
- $stems[] = $this->applyStemmer($normal_word);
+ foreach ($words as $word) {
+ $stems[] = $this->applyStemmer($word);
}
return implode(' ', $stems);
@@ -35,6 +35,10 @@
return phutil_utf8_strtolower($token);
}
+ private function normalizeCorpus($corpus) {
+ return phutil_utf8_strtolower($corpus);
+ }
+
/**
* @phutil-external-symbol class Porter
*/

File Metadata

Mime Type
text/plain
Expires
May 16 2024, 4:53 AM (4 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6290924
Default Alt Text
D18648.diff (1023 B)

Event Timeline