File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed
Sources/SQLiteDB/Extensions Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,11 @@ with built-in [SQLCipher] and [Full-text search] extensions,
55along with a [ SQLiteDB] Swift package that provides
66API parity with the venerable [ SQLite.swift] project.
77
8- This is a stand-along and platform-agnostic project, and
8+ This is a stand-alone and platform-agnostic project, and
99does not presume the presence of any SQLite binary.
1010It is therefore suitable for embedded projects or
11- environments without any accessible ` sqlite3.so ` library (e.g., Android).
11+ environments without any accessible system ` sqlite3 `
12+ library (e.g., Android, Windows).
1213
1314## Features
1415
Original file line number Diff line number Diff line change @@ -115,9 +115,19 @@ public struct Tokenizer {
115115 return Tokenizer ( " unicode61 " , arguments)
116116 }
117117
118- // https://sqlite.org/fts5.html#the_experimental_trigram_tokenizer
119- public static func Trigram( caseSensitive: Bool = false ) -> Tokenizer {
120- Tokenizer ( " trigram " , [ " case_sensitive " , caseSensitive ? " 1 " : " 0 " ] )
118+ // https://sqlite.org/fts5.html#the_trigram_tokenizer
119+ public static func Trigram( caseSensitive: Bool ? = false , removeDiacritics: Bool ? = nil ) -> Tokenizer {
120+ var arguments = [ String] ( )
121+
122+ if let caseSensitive {
123+ arguments. append ( " case_sensitive \( caseSensitive ? 1 : 0 ) " )
124+ }
125+
126+ if let removeDiacritics {
127+ arguments. append ( " remove_diacritics \( removeDiacritics ? 1 : 0 ) " )
128+ }
129+
130+ return Tokenizer ( " trigram " , arguments)
121131 }
122132
123133 public static func Custom( _ name: String ) -> Tokenizer {
You can’t perform that action at this time.
0 commit comments