-
Notifications
You must be signed in to change notification settings - Fork 1
/
Config.swift
44 lines (35 loc) · 1.93 KB
/
Config.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* LipikaEngine is a multi-codepoint, user-configurable, phonetic, Transliteration Engine.
* Copyright (C) 2018 Ranganath Atreya
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
import Foundation
/// This class provides default config values that the client can override, typically using `UserDefaults` and pass an instance into `LiteratorFactory`.
open class Config {
/**
Empty public init to enable clients to call super.init()
*/
public init() {}
/**
This character is used to break input aggregation. Typically this is the forward-slash character (`\`).
__Example__: if `a` maps to `1` and `b` maps to `2` and `ab` maps to `3` then inputting `ab` will output `3` but inputting `a\b` will output `12`
*/
open var stopCharacter: UnicodeScalar { return "\\" }
/**
All input characters enclosed by this character will be echoed to the output as-is and not converted.
__Example__: if `a` maps to `1` and `b` maps to `2` and `ab` maps to `3` then inputting `ab` will output `3` but inputting `` `ab` `` will output `ab`
*/
open var escapeCharacter: UnicodeScalar { return "`" }
/**
The URL path to the top-level directory where the schemes files are present. Usually this would return something like `Bundle.main.bundleURL.appendingPathComponent("Mapping")`
*/
open var mappingDirectory: URL { return Bundle(for: Config.self).bundleURL.appendingPathComponent("Resources", isDirectory: true).appendingPathComponent("Mapping", isDirectory: true) }
/**
The level at which to NSLog log messages generated by LipikaEngine.
- Important: This configuration only holds within the same thread in which `LiteratorFactory` was initialized.
*/
open var logLevel: Logger.Level { return .warning }
}