diff --git a/Sources/SwiftNLP/1. Data Collection/DurableHNSWCorpus + Dictionary.swift b/Sources/SwiftNLP/1. Data Collection/DurableHNSWCorpus + Dictionary.swift index cc0711b2c6bf770251d86ce78c5541dace5cf114..d73152be76f5c2fcc878fa02d21de6b3a2a361bf 100644 --- a/Sources/SwiftNLP/1. Data Collection/DurableHNSWCorpus + Dictionary.swift +++ b/Sources/SwiftNLP/1. Data Collection/DurableHNSWCorpus + Dictionary.swift @@ -2,7 +2,7 @@ // HNSWCorpus + Dictionary.swift // // -// Created by Mingchung Xia on 2024-02-14. +// Created by Mingchung Xia on 2024-02-26. // import Foundation @@ -49,22 +49,3 @@ extension DurableHNSWCorpus { ) } } -// -//extension DurableHNSWCorpus.DocumentVectorPair: Codable where Scalar: Codable { -// enum CodingKeys: String, CodingKey { -// case untokenizedDocument -// case vector -// } -// -// internal init(from decoder: Decoder) throws { -// let container = try decoder.container(keyedBy: CodingKeys.self) -// untokenizedDocument = try container.decode(String.self, forKey: .untokenizedDocument) -// vector = try container.decode([Scalar].self, forKey: .vector) -// } -// -// internal func encode(to encoder: Encoder) throws { -// var container = encoder.container(keyedBy: CodingKeys.self) -// try container.encode(untokenizedDocument, forKey: .untokenizedDocument) -// try container.encode(vector, forKey: .vector) -// } -//} diff --git a/Sources/SwiftNLP/1. Data Collection/DurableHNSWCorpus + Sequence.swift b/Sources/SwiftNLP/1. Data Collection/DurableHNSWCorpus + Sequence.swift deleted file mode 100644 index efe0a1cc3274c24a93589ab464e04be1d6391861..0000000000000000000000000000000000000000 --- a/Sources/SwiftNLP/1. Data Collection/DurableHNSWCorpus + Sequence.swift +++ /dev/null @@ -1,63 +0,0 @@ -//// Copyright (c) 2024 Jim Wallace -//// -//// Permission is hereby granted, free of charge, to any person -//// obtaining a copy of this software and associated documentation -//// files (the "Software"), to deal in the Software without -//// restriction, including without limitation the rights 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 AUTHORS OR COPYRIGHT -//// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -//// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -//// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -//// OTHER DEALINGS IN THE SOFTWARE. -// -///// It may be more useful to make the conformances based on the dictionary instead of encodedDocuments -// -//extension DurableHNSWCorpus: Sequence, Collection { -// -// typealias Element = [Scalar] -// -// // Sequence Protocol Requirements -// @inlinable -// func makeIterator() -> AnyIterator<Element> { -// var index = 0 -// return AnyIterator { -// defer { index += 1 } -// guard index < self.encodedDocuments.base.vectors.count else { return nil } -// let element = self.encodedDocuments.base.vectors[index] // consider using .find -// return element -// } -// } -// -// // Collection Protocol Requirements -// @inlinable -// var startIndex: Int { -// return encodedDocuments.base.vectors.startIndex -// } -// -// @inlinable -// var endIndex: Int { -// return encodedDocuments.base.vectors.endIndex -// } -// -// @inlinable -// subscript(position: Int) -> Element { -// return encodedDocuments.base.vectors[position] -// } -// -// @inlinable -// func index(after i: Int) -> Int { -// return encodedDocuments.base.vectors.index(after: i) -// } -//} -//