-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LMAssembly // Pack LMUserOverride inside LMInstantiator, etc.
- Loading branch information
Showing
35 changed files
with
303 additions
and
316 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
...Chewing_LangModelAssembly/Sources/LangModelAssembly/LMInstantiator_UOMRepresentable.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// (c) 2021 and onwards The vChewing Project (MIT-NTL License). | ||
// ==================== | ||
// This code is released under the MIT license (SPDX-License-Identifier: MIT) | ||
// ... with NTL restriction stating that: | ||
// No trademark license is granted to use the trade names, trademarks, service | ||
// marks, or product names of Contributor, except as required to fulfill notice | ||
// requirements defined in MIT License. | ||
|
||
import Foundation | ||
import Megrez | ||
|
||
public extension LMAssembly.LMInstantiator { | ||
func performUOMObservation( | ||
walkedBefore: [Megrez.Node], | ||
walkedAfter: [Megrez.Node], | ||
cursor: Int, | ||
timestamp: Double, | ||
saveCallback: (() -> Void)? = nil | ||
) { | ||
lmUserOverride.performObservation( | ||
walkedBefore: walkedBefore, | ||
walkedAfter: walkedAfter, | ||
cursor: cursor, | ||
timestamp: timestamp, | ||
saveCallback: saveCallback | ||
) | ||
} | ||
|
||
func fetchUOMSuggestion( | ||
currentWalk: [Megrez.Node], | ||
cursor: Int, | ||
timestamp: Double | ||
) -> LMAssembly.OverrideSuggestion { | ||
lmUserOverride.fetchSuggestion( | ||
currentWalk: currentWalk, | ||
cursor: cursor, | ||
timestamp: timestamp | ||
) | ||
} | ||
|
||
func loadUOMData(fromURL fileURL: URL? = nil) { | ||
lmUserOverride.loadData(fromURL: fileURL) | ||
} | ||
|
||
func saveUOMData(toURL fileURL: URL? = nil) { | ||
lmUserOverride.saveData(toURL: fileURL) | ||
} | ||
|
||
func clearUOMData(withURL fileURL: URL? = nil) { | ||
lmUserOverride.clearData(withURL: fileURL) | ||
} | ||
|
||
func bleachSpecifiedUOMSuggestions(targets: [String], saveCallback: (() -> Void)? = nil) { | ||
lmUserOverride.bleachSpecifiedSuggestions(targets: targets, saveCallback: saveCallback) | ||
} | ||
|
||
func bleachUOMUnigrams(saveCallback: (() -> Void)? = nil) { | ||
lmUserOverride.bleachUnigrams(saveCallback: saveCallback) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.