Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: third_party/sqlite/src/ext/fts3/fts3_porter.c

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 ** 2006 September 30 2 ** 2006 September 30
3 ** 3 **
4 ** The author disclaims copyright to this source code. In place of 4 ** The author disclaims copyright to this source code. In place of
5 ** a legal notice, here is a blessing: 5 ** a legal notice, here is a blessing:
6 ** 6 **
7 ** May you do good and not evil. 7 ** May you do good and not evil.
8 ** May you find forgiveness for yourself and forgive others. 8 ** May you find forgiveness for yourself and forgive others.
9 ** May you share freely, never taking more than you give. 9 ** May you share freely, never taking more than you give.
10 ** 10 **
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 ** In prose: A word is an optional consonant followed by zero or 176 ** In prose: A word is an optional consonant followed by zero or
177 ** vowel-consonant pairs followed by an optional vowel. "m" is the 177 ** vowel-consonant pairs followed by an optional vowel. "m" is the
178 ** number of vowel consonant pairs. This routine computes the value 178 ** number of vowel consonant pairs. This routine computes the value
179 ** of m for the first i bytes of a word. 179 ** of m for the first i bytes of a word.
180 ** 180 **
181 ** Return true if the m-value for z is 1 or more. In other words, 181 ** Return true if the m-value for z is 1 or more. In other words,
182 ** return true if z contains at least one vowel that is followed 182 ** return true if z contains at least one vowel that is followed
183 ** by a consonant. 183 ** by a consonant.
184 ** 184 **
185 ** In this routine z[] is in reverse order. So we are really looking 185 ** In this routine z[] is in reverse order. So we are really looking
186 ** for an instance of of a consonant followed by a vowel. 186 ** for an instance of a consonant followed by a vowel.
187 */ 187 */
188 static int m_gt_0(const char *z){ 188 static int m_gt_0(const char *z){
189 while( isVowel(z) ){ z++; } 189 while( isVowel(z) ){ z++; }
190 if( *z==0 ) return 0; 190 if( *z==0 ) return 0;
191 while( isConsonant(z) ){ z++; } 191 while( isConsonant(z) ){ z++; }
192 return *z!=0; 192 return *z!=0;
193 } 193 }
194 194
195 /* Like mgt0 above except we are looking for a value of m which is 195 /* Like mgt0 above except we are looking for a value of m which is
196 ** exactly 1 196 ** exactly 1
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 ** Allocate a new porter tokenizer. Return a pointer to the new 653 ** Allocate a new porter tokenizer. Return a pointer to the new
654 ** tokenizer in *ppModule 654 ** tokenizer in *ppModule
655 */ 655 */
656 void sqlite3Fts3PorterTokenizerModule( 656 void sqlite3Fts3PorterTokenizerModule(
657 sqlite3_tokenizer_module const**ppModule 657 sqlite3_tokenizer_module const**ppModule
658 ){ 658 ){
659 *ppModule = &porterTokenizerModule; 659 *ppModule = &porterTokenizerModule;
660 } 660 }
661 661
662 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ 662 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
OLDNEW
« no previous file with comments | « third_party/sqlite/src/ext/fts3/fts3_icu.c ('k') | third_party/sqlite/src/ext/fts3/fts3_snippet.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698