Skip to content

Commit 9c5b5a2

Browse files
committed
Do not autocorrect words with dashes
1 parent e7db5b2 commit 9c5b5a2

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

java/src/org/futo/inputmethod/latin/Suggest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ public static SuggestedWords obtainNonBatchedInputSuggestedWords(
214214
// If we don't have suggestion results, we can't evaluate the first suggestion
215215
// for auto-correction
216216
|| suggestionResults.isEmpty()
217+
// If the word has dashes, we never auto-correct because it had to have been
218+
// typed with a lot of care
219+
|| wordComposer.hasDashes()
217220
// If the word has digits, we never auto-correct because it's likely the word
218221
// was type with a lot of care, unless number row is active
219222
|| (wordComposer.hasDigits() && !numberRowActive)

java/src/org/futo/inputmethod/latin/WordComposer.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,13 @@ public boolean hasDigits() {
371371
return mDigitsCount > 0;
372372
}
373373

374+
/**
375+
* Returns true if we have dashes in the composing word.
376+
*/
377+
public boolean hasDashes() {
378+
return getTypedWord().indexOf('-') != -1;
379+
}
380+
374381
/**
375382
* Returns true if the composing word is entirely digits.
376383
*/

0 commit comments

Comments
 (0)