Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions AutoCorrect.h

This file was deleted.

78 changes: 0 additions & 78 deletions AutoCorrect.m

This file was deleted.

31 changes: 31 additions & 0 deletions AutoCorrect.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// AutoCorrect.swift
// AvroKeyboard
//
// Created by Mamnun Bhuiyan on 26/4/17.
//
//

import Foundation

@objc public class AutoCorrect: NSObject {
var entries: [String: String] = [:]

static let shared: AutoCorrect = AutoCorrect()

override init() {
super.init()
guard let filePath = Bundle.main.path(forResource: "autodict", ofType: "plist") else { return }

if FileManager.default.fileExists(atPath: filePath) {
if let dict = NSDictionary(contentsOfFile: filePath) as? [String:String] {
entries = dict
}
}
}

public func find(_ term:String) -> String? {
guard let fixedTerm = AvroParser.sharedInstance().fix(term) else { return nil }
return entries[fixedTerm]
}
}
16 changes: 0 additions & 16 deletions AutoCorrectItem.h

This file was deleted.

58 changes: 0 additions & 58 deletions AutoCorrectItem.m

This file was deleted.

23 changes: 23 additions & 0 deletions AutoCorrectItem.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// AutoCorrectItem.swift
// AvroKeyboard
//
// Created by Max on 4/25/17.
//
//

import Foundation


/// A simple model wrapper class for auto currect entry. this class is only used for databinding in PreferencesController tableview

@objc public class AutoCorrectItem: NSObject {
var replace: String
var with: String

init(replace:String = "replace", with:String = "with") {
self.replace = replace
self.with = with
super.init()
}
}
8 changes: 8 additions & 0 deletions AvroKeyboard-Bridging-Header.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//

#import "AvroParser.h"
#import "FMDatabase.h"
#import "RegexKitLite.h"
#import "RegexParser.h"
Loading