mirror of
https://github.com/mii443/AzooKeyKanaKanjiConverter.git
synced 2025-12-03 02:58:27 +00:00
[Fix] 制約の適用を調整した (#96)
* zenz-v1側は制約をコードポイントレベルで喋るので、grapheme clusterに非依存の処理に書き換えた * EOSを考慮するように変更
This commit is contained in:
@@ -86,6 +86,20 @@ public extension Collection {
|
||||
}
|
||||
|
||||
public extension Collection where Self.Element: Equatable {
|
||||
/// Returns a Bool value indicating whether the collection has the given prefix.
|
||||
/// - Parameters:
|
||||
/// - prefix: A collection to search for at the start of this collection.
|
||||
/// - Returns: A Bool value indicating whether the collection has the given prefix.
|
||||
@inlinable func hasPrefix(_ prefix: some Collection<Element>) -> Bool {
|
||||
if self.count < prefix.count {
|
||||
return false
|
||||
}
|
||||
for (u, v) in zip(self, prefix) where u != v {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
/// Returns a Bool value indicating whether the collection has the given suffix.
|
||||
/// - Parameters:
|
||||
/// - suffix: A collection to search for at the end of this collection.
|
||||
|
||||
Reference in New Issue
Block a user