Questions tagged [uitextchecker]

Used to check a string (usually the text of a document) for misspelled words.

UITextChecker spell-checks using a lexicon for a given language. Available since 3.2

Reference

21 questions
8
votes
1 answer

How to disable logging?

I have an app that is making use of UITextChecker class provided by Apple. This class has a following bug: If the iOS device is offline (expected to be often for my app) each time I call some of UITextCheckers methods it logs following to…
Rasto
  • 17,204
  • 47
  • 154
  • 245
4
votes
0 answers

UITextChecker and non english words

I'm developing a custom keyboard for the iOS operating system and I'm trying to add the auto-suggestion feature. For English dictionary there seems to be no difficulties, but for languages like french I came into a problem regarding accents. See…
4
votes
0 answers

Way to have UITextChecker suggest learned words?

I would like to add words to the Apple Dictionary used by UITextChecker, and I am aware of the learnWords: method. It's documentation, and my experience with it, suggest that it only serves to ignore words that are learned. What I would like, and…
TahoeWolverine
  • 1,749
  • 2
  • 23
  • 31
2
votes
1 answer

UITextView, with spell checking, how to use `ignoreWord`?

Regarding the spell checking in iOS, it's possible to tell the checker to ignore a word (or learn a word), https://developer.apple.com/documentation/uikit/uitextchecker func ignoreWord(String) Tells the receiver to ignore the specified word when…
Fattie
  • 27,874
  • 70
  • 431
  • 719
2
votes
1 answer

Autocorrection and Suggestion for custom keyboard

I want to add Autocorrection and Suggestion to my custom keyboard. There are already several similar questions on Stack, but there is only said about UILexicon which as I understood is only used to get user's shortcuts and that there is no way to…
Edgar
  • 898
  • 2
  • 12
  • 36
2
votes
1 answer

Swift UITextChecker

I am trying to use UITextChecker in my Swift project. The code below currently has an error on the last line: var checker:UITextChecker = UITextChecker() var textLength = countElements(textView.text) var checkRange:NSRange =…
Tom Coomer
  • 6,227
  • 12
  • 45
  • 82
1
vote
1 answer

SwiftUI - Spell Checking Multi-line String

I am trying to create a function where a multi-line string is spell checked and a single SwiftUI Text() view is returned with any misspelled words highlighted in red. I have almost cracked it by splitting the string by newlines, then splitting the…
1
vote
1 answer

Can UITextChecker access Thesaurus instead of Dictionary?

I'm aware that UITextChecker is used to check for misspelled words, but can it be used to access the Thesaurus? For example, how can I check if a string is similar to another string. For example: Is "Car" similar to "Vehicle". Does iOS have a native…
dub
  • 441
  • 1
  • 3
  • 17
1
vote
1 answer

Check grammar of user input

I am making an app that checks the user's English grammar and I wanted to know if there was a way of checking a string and correcting it if its grammar is incorrect. I know UITextChecker only corrects the words if they are wrong but not the grammar…
Yeung Andy
  • 25
  • 6
1
vote
2 answers

UITextChecker completionsForPartialWordRange

I'm building custom keyboard extension and want to implement autocompletion, like Apple does. As I see method completionsForPartialWordRangereturns list of words sorted alphabetically. How can I get results sorted by usage?
landonandrey
  • 1,271
  • 1
  • 16
  • 26
1
vote
1 answer

UITextChecker: Way to Check If Word is Already Correct?

UITextChecker' rangeOfMisspelledWordInString:range:startingAt:wrap:language: returns nil if no correction is found. However I was wondering if there's a way to tell if no correction was found because A. It's already correct or B. Nothing Exists for…
KingPolygon
  • 4,753
  • 7
  • 43
  • 72
1
vote
1 answer

UITextChecker Crashes When it Can't Guess a Word

I've searched for help and couldn't find it here. I have a button that checks the spelling, and then replaces the words with a guess. I have the following code inside the button: UITextChecker *checker = [[UITextChecker alloc] init]; NSRange…
Hedylove
  • 1,724
  • 16
  • 26
0
votes
0 answers

I’m trying to use UITextChecker to verify the existence of a word. I wrote a small test program that is giving me baffling results

Below is test code I wrote in a Swift Playground. It shows UITextChecker is not working reliably. import UIKit func validWord(word: String) -> Bool { let checker = UITextChecker() let range = NSRange(location: 0, length:…
Richard Goggin
  • 331
  • 2
  • 4
0
votes
1 answer

How to get context of a sentence

So i'm working a an app that can patch words that are broken. Lets take: mny people say there is a error in this sentence With swift here we can us UITextChecker and get a wonderful result of what the word mny could actually be... However, i…
Vollan
  • 1,887
  • 11
  • 26
0
votes
1 answer

UITextChecker for Set of Strings - Swift 4.2

I currently have this Extension thanks to @Leo Dabus. It works perfectly for a single String, but how would I implement this same logic to an Set of Strings like var mySet = ["word", "notaword", "stillnotaword"]. In this example, I would want the…
user9470831
1
2