LiteratorFactory
public class LiteratorFactory
Use this class to get an instance of Transliterator and Anteliterator. This class is responsible for the two step initialization that is needed to generate an instance of Transliterator or Anteliterator.
Important
Handle any exception that are thrown frominit, transliterator and anteliterator - these are indicative of a bad config.
-
Available schemes in the scheme directory provided by the custom implementation of
Configthat was used to initialize this factory class.Throws
EngineErrorDeclaration
Swift
public func availableSchemes() throws -> [String]Return Value
Array of scheme names that can be passed to the
instancefunction -
Available scripts in the scheme directory provided by the given implementation of
Configthat was used to initialize this factory class.Throws
EngineErrorDeclaration
Swift
public func availableScripts() throws -> [String]Return Value
Array of script names that can be passed to the
transliteratororanteliteratorfunction -
Available custom mappings in the directory provided by the given implementation of
Configthat was used to initialize this factory class.Throws
EngineErrorDeclaration
Swift
public func availableCustomMappings() throws -> [String]Return Value
Array of customMapping names that can be passed to the
transliteratororanteliteratorfunction -
Get the underlying mappings for the specified scheme and script.
- schemeName: Name of the scheme which should be one of
availableSchemes- scriptName: Name of the script which should be one of
availableScriptsThrows
EngineErrorDeclaration
Swift
public func mappings(schemeName: String, scriptName: String) throws -> [String : MappingValue]Return Value
A nested map of Type->Key->([Scheme], Script)
- schemeName: Name of the scheme which should be one of
-
Get an instance of Transliterator for the specified scheme and script.
Note
Typically clients retrieve the mappings using themappingsAPI, modify it and optionally pass it into the mappings parameterThrows
EngineErrorDeclaration
Swift
public func transliterator(schemeName: String, scriptName: String, mappings: [String : MappingValue]? = nil) throws -> TransliteratorParameters
schemeNameName of the scheme which should be one of
availableSchemesscriptNameName of the script which should be one of
availableScriptsmappingsA nested map of Type->Key->([Scheme], Script) that will override the built-in mappings
Return Value
Instance of Transliterator for the given scheme and script
-
Get an instance of Anteliterator for the specified scheme and script.
Note
Typically clients retrieve the mappings using themappingsAPI, modify it and optionally pass it into the mappings parameterThrows
EngineErrorDeclaration
Swift
public func anteliterator(schemeName: String, scriptName: String, mappings: [String : MappingValue]? = nil) throws -> AnteliteratorParameters
schemeNameName of the scheme which should be one of
availableSchemesscriptNameName of the script which should be one of
availableScriptsmappingsA nested map of Type->Key->([Scheme], Script) that will override the built-in mappings
Return Value
Instance of Anteliterator for the given scheme and script
-
Get an instance of Transliterator for the specified customMapping.
Throws
EngineErrorDeclaration
Swift
public func transliterator(customMapping: String) throws -> TransliteratorParameters
customMappingName of the customMapping which should be one of
availableCustomMappingsReturn Value
Instance of Transliterator for the given customMapping
-
Get an instance of Anteliterator for the specified customMapping.
Throws
EngineErrorDeclaration
Swift
public func anteliterator(customMapping: String) throws -> AnteliteratorParameters
customMappingName of the customMapping which should be one of
availableCustomMappingsReturn Value
Instance of Anteliterator for the given customMapping
View on GitHub
LiteratorFactory Class Reference