refactor(vocab): improve text normalization consistency in VocabService and VocabLessonView
All checks were successful
Deploy to production / deploy (push) Successful in 2m56s
All checks were successful
Deploy to production / deploy (push) Successful in 2m56s
- Enhanced text normalization methods in both VocabService and VocabLessonView to include an additional trim operation, ensuring leading and trailing spaces are removed. - This change improves the consistency and accuracy of text handling across the application, contributing to better user input processing.
This commit is contained in:
@@ -346,7 +346,8 @@ export default class VocabService {
|
||||
.trim()
|
||||
.toLowerCase()
|
||||
.replace(/[\p{P}]+/gu, ' ')
|
||||
.replace(/\s+/g, ' ');
|
||||
.replace(/\s+/g, ' ')
|
||||
.trim();
|
||||
}
|
||||
|
||||
_parseExercisePayload(value) {
|
||||
|
||||
@@ -2705,7 +2705,8 @@ export default {
|
||||
.trim()
|
||||
.toLowerCase()
|
||||
.replace(/[\p{P}]+/gu, ' ')
|
||||
.replace(/\s+/g, ' ');
|
||||
.replace(/\s+/g, ' ')
|
||||
.trim();
|
||||
},
|
||||
normalizeVocab(s) {
|
||||
return this.normalizeComparableText(s);
|
||||
|
||||
Reference in New Issue
Block a user