From eb6620df17a1227ec88f933734457be1e3c7fc70 Mon Sep 17 00:00:00 2001 From: "jake.oeding" Date: Fri, 30 Jan 2026 20:49:02 -0500 Subject: [PATCH 1/2] remove empty comments and trailing spaces --- Sources/DictionaryKit/TTTDictionary.m | 2 +- Sources/DictionaryKit/include/DictionaryKit.h | 8 ++--- Sources/DictionaryKit/include/TTTDictionary.h | 36 +------------------ 3 files changed, 6 insertions(+), 40 deletions(-) diff --git a/Sources/DictionaryKit/TTTDictionary.m b/Sources/DictionaryKit/TTTDictionary.m index 0748aa6..af8d029 100644 --- a/Sources/DictionaryKit/TTTDictionary.m +++ b/Sources/DictionaryKit/TTTDictionary.m @@ -91,7 +91,7 @@ - (instancetype)initWithRecordRef:(CFTypeRef)record if (self.headword) { self.text = (__bridge_transfer NSString*)DCSRecordCopyData(record, TTTDictionaryVersionText); } - + self.HTML = (__bridge_transfer NSString *)DCSRecordCopyData(record, (long)TTTDictionaryVersionHTMLWithPopoverCSS); return self; diff --git a/Sources/DictionaryKit/include/DictionaryKit.h b/Sources/DictionaryKit/include/DictionaryKit.h index 796c64a..2fb4d20 100644 --- a/Sources/DictionaryKit/include/DictionaryKit.h +++ b/Sources/DictionaryKit/include/DictionaryKit.h @@ -1,5 +1,5 @@ // DictionaryKit.h -// +// // Copyright (c) 2014 Mattt Thompson // // Permission is hereby granted, free of charge, to any person obtaining a copy @@ -8,10 +8,10 @@ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#ifndef _DICTIONARY_KIT_ +#ifndef _DICTIONARY_KIT_ #define _DICTIONARY_KIT_ #import "TTTDictionary.h" diff --git a/Sources/DictionaryKit/include/TTTDictionary.h b/Sources/DictionaryKit/include/TTTDictionary.h index cb8a7f0..6aa1081 100644 --- a/Sources/DictionaryKit/include/TTTDictionary.h +++ b/Sources/DictionaryKit/include/TTTDictionary.h @@ -22,59 +22,25 @@ #import -/** - - */ @interface TTTDictionaryEntry : NSObject -/** - - */ @property (readonly, nonatomic, copy, nullable) NSString *headword; - -/** - - */ @property (readonly, nonatomic, copy, nullable) NSString *text; - -/** - - */ @property (readonly, nonatomic, copy, nullable) NSString *HTML; @end #pragma mark - -/** - - */ @interface TTTDictionary : NSObject -/** - - */ @property (readonly, nonatomic, copy, nullable) NSString *name; - -/** - - */ @property (readonly, nonatomic, copy, nullable) NSString *shortName; -/** - - */ + (nonnull NSSet *)availableDictionaries; - -/** - - */ + (nullable instancetype)dictionaryNamed:(nonnull NSString *)name; - -/** - - */ - (nonnull NSArray *)entriesForSearchTerm:(nonnull NSString *)term; + @end /// @name Constants From 12cdc879bb7ca6cd53434520c8b3b04b9497ddd6 Mon Sep 17 00:00:00 2001 From: "jake.oeding" Date: Fri, 30 Jan 2026 21:54:36 -0500 Subject: [PATCH 2/2] add identifier to TTTDictionary --- Sources/DictionaryKit/TTTDictionary.m | 4 +++- Sources/DictionaryKit/include/TTTDictionary.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Sources/DictionaryKit/TTTDictionary.m b/Sources/DictionaryKit/TTTDictionary.m index af8d029..b73671e 100644 --- a/Sources/DictionaryKit/TTTDictionary.m +++ b/Sources/DictionaryKit/TTTDictionary.m @@ -55,7 +55,7 @@ typedef NS_ENUM(NSInteger, TTTDictionaryRecordVersion) { extern CFStringRef DCSDictionaryGetName(DCSDictionaryRef dictionary); extern CFStringRef DCSDictionaryGetShortName(DCSDictionaryRef dictionary); extern DCSDictionaryRef DCSDictionaryCreate(CFURLRef url); -extern CFStringRef DCSDictionaryGetName(DCSDictionaryRef dictionary); +extern CFStringRef DCSDictionaryGetIdentifier(DCSDictionaryRef dictionary); extern CFArrayRef DCSCopyRecordsForSearchString(DCSDictionaryRef dictionary, CFStringRef string, void *, void *); extern CFDictionaryRef DCSCopyDefinitionMarkup(DCSDictionaryRef dictionary, CFStringRef record); @@ -101,6 +101,7 @@ - (instancetype)initWithRecordRef:(CFTypeRef)record @interface TTTDictionary () @property (readwrite, nonatomic, assign) DCSDictionaryRef dictionary; +@property (readwrite, nonatomic, copy) NSString *identifier; @property (readwrite, nonatomic, copy) NSString *name; @property (readwrite, nonatomic, copy) NSString *shortName; @end @@ -145,6 +146,7 @@ - (instancetype)initWithDictionaryRef:(DCSDictionaryRef)dictionary { } self.dictionary = dictionary; + self.identifier = (__bridge NSString *)DCSDictionaryGetIdentifier(self.dictionary); self.name = (__bridge NSString *)DCSDictionaryGetName(self.dictionary); self.shortName = (__bridge NSString *)DCSDictionaryGetShortName(self.dictionary); diff --git a/Sources/DictionaryKit/include/TTTDictionary.h b/Sources/DictionaryKit/include/TTTDictionary.h index 6aa1081..4fc2e21 100644 --- a/Sources/DictionaryKit/include/TTTDictionary.h +++ b/Sources/DictionaryKit/include/TTTDictionary.h @@ -34,6 +34,7 @@ @interface TTTDictionary : NSObject +@property (readonly, nonatomic, copy, nullable) NSString *identifier; @property (readonly, nonatomic, copy, nullable) NSString *name; @property (readonly, nonatomic, copy, nullable) NSString *shortName;