-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update hindu.json #4708
Update hindu.json #4708
Conversation
- Removing uncommon hindi/sanskrit synonyms - Add common English spellings of Hindu temples in various Indian languages.
"devasthana", | ||
"mandir", | ||
"kshetram", | ||
"alayam", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the code below, is it the case that iD no longer weights matching terms by how close they are to the beginning of this list? (If so, that would explain the poor results I always get in Vietnamese, which includes a diacritic-less copy of every term at the end of the list.)
iD/modules/presets/collection.js
Lines 110 to 115 in 015c891
// finds close matches to value in preset.terms | |
var similar_terms = _filter(searchable, function(a) { | |
return _some(a.terms() || [], function(b) { | |
return utilEditDistance(value, b) + Math.min(value.length - b.length, 0) < 3; | |
}); | |
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@1ec5 The preset collection test suite has a good example of how the search priority is supposed to work:
iD/test/spec/presets/collection.js
Lines 101 to 109 in 1aebbc5
it('returns alternate matches in correct order', function() { | |
var col = c.search('gri', 'point').matchGeometry('point').collection; | |
expect(col.indexOf(p.grill), 'Grill').to.eql(0); // 1. 'Grill' (leading name) | |
expect(col.indexOf(p.football), 'Football').to.eql(1); // 2. 'Football' (leading term 'gridiron') | |
expect(col.indexOf(p.sandpit), 'Sandpit').to.eql(2); // 3. 'Sandpit' (leading tag value 'grit_bin') | |
expect(col.indexOf(p.grass1), 'Grass').to.be.within(3,5); // 4. 'Grass' (similar name) | |
expect(col.indexOf(p.grass2), 'Ğṝȁß').to.be.within(3,5); // 5. 'Ğṝȁß' (similar name) | |
expect(col.indexOf(p.park), 'Park').to.be.within(3,5); // 6. 'Park' (similar term 'grass') | |
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I was wondering whether it makes a difference for a localization to sort the terms
from most relevant to least relevant. This test case contains no terms
array with multiple elements. But I can look into that – thanks for the pointer.
Thank you @bhousel ❤️ |
Of course! Thank you for the PR - I usually don't know what search terms people might want to use, so I often just guess. |
cc @srividyacb