Skip to content

Commit

Permalink
Replace similar characters
Browse files Browse the repository at this point in the history
In french, it is better to use ’ instead of ' in many sentences (eg: l’)
Can be extended later with other terms if needed
  • Loading branch information
mart-e committed Apr 14, 2024
1 parent 3a19408 commit d620f58
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,13 @@ var ngramTypeConfig = {

// Remove spaces at starting of the phrase
var typedPhrase = this.typedPhrase.trimStart();
var substitutions = [
["’", "'"],
["œ", "oe"],
];
for (var subst of substitutions) {
typedPhrase = typedPhrase.replaceAll(subst[0], subst[1]);
}
if (!typedPhrase.length) {
return;
}
Expand Down

0 comments on commit d620f58

Please sign in to comment.