mirror of
https://github.com/mii443/AzooKeyKanaKanjiConverter.git
synced 2025-08-22 15:05:26 +00:00
feat: SwiftNGramWithMarisaTrieへの依存を除去し、内部の実装をターゲットとして追加 (#153)
This commit is contained in:
14
Tests/EfficientNGramTests/EfficientNGramTests.swift
Normal file
14
Tests/EfficientNGramTests/EfficientNGramTests.swift
Normal file
@ -0,0 +1,14 @@
|
||||
import XCTest
|
||||
@testable import EfficientNGram
|
||||
import Tokenizers
|
||||
|
||||
class SwiftNGramTests: XCTestCase {
|
||||
#if canImport(SwiftyMarisa)
|
||||
func testTokenizers() throws {
|
||||
let tokenizer = ZenzTokenizer()
|
||||
let inputIds = tokenizer.encode(text: "これは日本語です")
|
||||
XCTAssertEqual(inputIds, [268, 262, 253, 304, 358, 698, 246, 255])
|
||||
XCTAssertEqual(tokenizer.decode(tokens: inputIds), "これは日本語です")
|
||||
}
|
||||
#endif
|
||||
}
|
Reference in New Issue
Block a user