From 87f35da404717365aef9a8495e8fca98b970d5dc Mon Sep 17 00:00:00 2001 From: Eddie Antonio Santos Date: Tue, 21 Apr 2020 15:44:18 -0600 Subject: [PATCH] test(common/lmlayer): fix expecations for Turkic orthography --- developer/js/tests/test-default-search-term-to-key.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/developer/js/tests/test-default-search-term-to-key.ts b/developer/js/tests/test-default-search-term-to-key.ts index 0aea01817a..0926a656fc 100644 --- a/developer/js/tests/test-default-search-term-to-key.ts +++ b/developer/js/tests/test-default-search-term-to-key.ts @@ -6,10 +6,15 @@ import { defaultSearchTermToKey } from '../dist/lexical-model-compiler/build-tri describe('The default searchTermToKey() function', function () { it('should lowercase and THEN normalize', function() { - // "İstanbul" has a DOTTED-I. This should be lowercased, - // then have its dot removed! + // "İstanbul" has a U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE. + // This should be lowercased. assert.equal(defaultSearchTermToKey('İstanbul'), 'istanbul'); - assert.equal(defaultSearchTermToKey('Diyarbakır'), 'diyarbakır'); + // The DEFAULT function is NOT responsible for understanding the Turkish + // case regarding the lowercasing of: + // 'I' U+0048 LATIN CAPITAL LETTER I to 'ı' U+0131 LATIN SMALL LETTER DOTLESS I + // For Turkic languages, the recommendation is to make a + // custom searchTermToKey function: + assert.equal(defaultSearchTermToKey('DİYARBAKIR'), 'diyarbakir'); // "skýlos" is Greek for dog 🇬🇷🐶 // starts with an 's' and ends with an 's'