Skip to content

Commit

Permalink
Merge pull request #791 from ccgus/robertmryan/update-documentation
Browse files Browse the repository at this point in the history
Update header comments & documentation
  • Loading branch information
ccgus committed May 12, 2020
2 parents eae75f1 + d09c0d8 commit 61e51fd
Show file tree
Hide file tree
Showing 8 changed files with 482 additions and 451 deletions.
12 changes: 6 additions & 6 deletions src/extra/fts3/FMDatabase+FTS3.h
Expand Up @@ -36,12 +36,12 @@ extern NSString *const kFTSCommandAutoMerge; // "automerge=%u"
+ (void)registerTokenizer:(id<FMTokenizerDelegate>)tokenizer withKey:(NSString *)key;

/**
Calls the `fts3_tokenizer()` function on this database, installing tokenizer module with the 'fmdb' name.
Calls the @c fts3_tokenizer function on this database, installing tokenizer module with the 'fmdb' name.
*/
- (BOOL)installTokenizerModule;

/**
Calls the `fts3_tokenizer()` function on this database, installing the tokenizer module with specified name.
Calls the @c fts3_tokenizer function on this database, installing the tokenizer module with specified name.
*/
- (BOOL)installTokenizerModuleWithName:(NSString *)name;

Expand Down Expand Up @@ -89,8 +89,8 @@ typedef struct FMTokenizerCursor

/**
Enumerate each set of offsets in the result. The column number can be turned into a column name
using `[FMResultSet columnNameForIndex:]`. The `matchRange` is in UTF-8 byte positions, so it must be
modified to use with `NSString` data.
using `[FMResultSet columnNameForIndex:]`. The @c matchRange is in UTF-8 byte positions, so it must be
modified to use with @c NSString data.
*/
- (void)enumerateWithBlock:(void (^)(NSInteger columnNumber, NSInteger termNumber, NSRange matchRange))block;

Expand All @@ -102,12 +102,12 @@ typedef struct FMTokenizerCursor
@interface FMResultSet (FTS3)

/**
Returns a structure containing values from the `offsets()` function. Make sure the column index corresponds
Returns a structure containing values from the @c offsets function. Make sure the column index corresponds
to the column index in the SQL query.
@param columnIdx Zero-based index for column.
@return `FMTextOffsets` structure.
@return @c FMTextOffsets structure.
*/
- (FMTextOffsets *)offsetsForColumnIndex:(int)columnIdx;

Expand Down
12 changes: 10 additions & 2 deletions src/extra/fts3/FMTokenizers.h
Expand Up @@ -18,7 +18,9 @@ NS_ASSUME_NONNULL_BEGIN

/**
Create the tokenizer with a given locale. The locale will be used to initialize the string tokenizer and to lowercase the parsed word.
The locale can be `NULL`, in which case the current locale will be used.
@param locale The locale used by the simple tokenizer. The locale can be @c NULL , in which case the current locale will be used.
*/
- (instancetype)initWithLocale:(CFLocaleRef _Nullable)locale;

Expand All @@ -35,12 +37,18 @@ NS_ASSUME_NONNULL_BEGIN

/**
Load a stop-word tokenizer using a file containing words delimited by newlines. The file should be encoded in UTF-8.
@param wordFileURL The file URL for the list of words.
@param tokenizer The @c FMTokenizerDelegate .
@param error The @c NSError if there was any error reading the file.
*/
+ (instancetype)tokenizerWithFileURL:(NSURL *)wordFileURL baseTokenizer:(id<FMTokenizerDelegate>)tokenizer error:(NSError * _Nullable *)error;

/**
Initialize an instance of the tokenizer using the set of words. The words should be lowercase if you're using the
Initialize an instance of the tokenizer using the set of words. The words should be lowercase if you're using the
`FMSimpleTokenizer` as the base.
@param words The @c NSSet of words.
@param tokenizer The @c FMTokenizerDelegate .
*/
- (instancetype)initWithWords:(NSSet *)words baseTokenizer:(id<FMTokenizerDelegate>)tokenizer;

Expand Down

0 comments on commit 61e51fd

Please sign in to comment.