Skip to content

Commit

Permalink
Add missing Polish diacritics
Browse files Browse the repository at this point in the history
  • Loading branch information
avalanchy committed Oct 27, 2014
1 parent dc08814 commit 2b5269e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
11 changes: 6 additions & 5 deletions lib/sifter.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,19 +425,20 @@
};

var DIACRITICS = {
'a': '[aÀÁÂÃÄÅàáâãäåĀā]',
'a': '[aÀÁÂÃÄÅàáâãäåĀāąĄ]',
'c': '[cÇçćĆčČ]',
'd': '[dđĐďĎ]',
'e': '[eÈÉÊËèéêëěĚĒē]',
'e': '[eÈÉÊËèéêëěĚĒēęĘ]',
'i': '[iÌÍÎÏìíîïĪī]',
'n': '[nÑñňŇ]',
'l': '[lłŁ]',
'n': '[nÑñňŇńŃ]',
'o': '[oÒÓÔÕÕÖØòóôõöøŌō]',
'r': '[rřŘ]',
's': '[sŠš]',
's': '[sŠšśŚ]',
't': '[tťŤ]',
'u': '[uÙÚÛÜùúûüůŮŪū]',
'y': '[yŸÿýÝ]',
'z': '[zŽž]'
'z': '[zŽžżŻźŹ]'
};

// export
Expand Down
22 changes: 11 additions & 11 deletions test/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('Sifter', function() {
assert.equal(tokens[0].regex.test('afawfaf'), false);
});
it('should match international characters', function() {
assert.equal(tokens[0].regex.test('hellö'), true);
assert.equal(tokens[0].regex.test('hęłlö'), true);
assert.equal(tokens[1].regex.test('wÕrld'), true);
});
});
Expand Down Expand Up @@ -124,7 +124,7 @@ describe('Sifter', function() {
var search = sifter.prepareSearch('a', {
fields: {field: 'a'},
sort: {field: 'a'},
sort_empty: {field: 'a'},
sort_empty: {field: 'a'}
});
assert.equal(Array.isArray(search.options.fields), true);
assert.equal(Array.isArray(search.options.sort), true);
Expand Down Expand Up @@ -175,12 +175,12 @@ describe('Sifter', function() {
var sifter = new Sifter([
{field: 'aaa'},
{field: 'add'},
{field: 'abb'},
{field: 'abb'}
]);
var result = sifter.search('', {
fields: 'field',
sort: {field: 'field', direction: 'asc'},
sort_empty: {field: 'field', direction: 'desc'},
sort_empty: {field: 'field', direction: 'desc'}
});
assert.equal(result.items[0].id, 1);
assert.equal(result.items[1].id, 2);
Expand All @@ -190,7 +190,7 @@ describe('Sifter', function() {
var sifter = new Sifter([
{field: 'aaa'},
{field: 'add'},
{field: 'abb'},
{field: 'abb'}
]);
var result = sifter.search('', {
fields: 'field',
Expand All @@ -204,7 +204,7 @@ describe('Sifter', function() {
var sifter = new Sifter([
{field: 'aaa'},
{field: 'add'},
{field: 'abb'},
{field: 'abb'}
]);
var result = sifter.search('', {
fields: 'field',
Expand All @@ -219,7 +219,7 @@ describe('Sifter', function() {
{a: 'bbb', b: 'bbb'},
{a: 'bbb', b: 'ccc'},
{a: 'bbb', b: 'aaa'},
{a: 'aaa'},
{a: 'aaa'}
]);
var result = sifter.search('', {
fields: 'field',
Expand All @@ -238,7 +238,7 @@ describe('Sifter', function() {
{field: 1.0},
{field: 12.9},
{field: 9.1},
{field: -9.0},
{field: -9.0}
]);
var result = sifter.search('', {
fields: 'field',
Expand All @@ -260,7 +260,7 @@ describe('Sifter', function() {
fields: 'field',
sort: [
{field: 'b', direction: 'desc'},
{field: 'a', direction: 'asc'},
{field: 'a', direction: 'asc'}
]
});
assert.equal(result.items[0].id, 2);
Expand All @@ -271,7 +271,7 @@ describe('Sifter', function() {
it('should add implicit "$score" field when query present', function() {
var sifter = new Sifter([
{field: 'yoo'},
{field: 'book'},
{field: 'book'}
]);
var result = sifter.search('oo', {
fields: 'field',
Expand All @@ -284,7 +284,7 @@ describe('Sifter', function() {
var sifter = new Sifter([
{field: 'boooo'},
{field: 'yoo'},
{field: 'aaa'},
{field: 'aaa'}
]);
var result = sifter.search('oo', {
filter: false,
Expand Down

0 comments on commit 2b5269e

Please sign in to comment.