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,
5
5
along with a [ SQLiteDB] Swift package that provides
6
6
API parity with the venerable [ SQLite.swift] project.
7
7
8
- This is a stand-along and platform-agnostic project, and
8
+ This is a stand-alone and platform-agnostic project, and
9
9
does not presume the presence of any SQLite binary.
10
10
It 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).
12
13
13
14
## Features
14
15
Original file line number Diff line number Diff line change @@ -115,9 +115,19 @@ public struct Tokenizer {
115
115
return Tokenizer ( " unicode61 " , arguments)
116
116
}
117
117
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)
121
131
}
122
132
123
133
public static func Custom( _ name: String ) -> Tokenizer {
You can’t perform that action at this time.
0 commit comments