Skip to content
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

Merged
merged 1 commit into from
Jan 19, 2018
Merged

Update hindu.json #4708

merged 1 commit into from
Jan 19, 2018

Conversation

planemad
Copy link
Contributor

  • Removing uncommon hindi/sanskrit synonyms
  • Add common English spellings of Hindu temples in various Indian languages.

cc @srividyacb

- Removing uncommon hindi/sanskrit synonyms
- Add common English spellings of Hindu temples in various Indian languages.
"devasthana",
"mandir",
"kshetram",
"alayam",
Copy link
Collaborator

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.)

// 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;
});
});

Copy link
Member

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:

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')
});

Copy link
Collaborator

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.

@bhousel bhousel merged commit 2f01dcc into openstreetmap:master Jan 19, 2018
@planemad
Copy link
Contributor Author

Thank you @bhousel ❤️

@planemad planemad deleted the patch-1 branch January 19, 2018 14:01
@bhousel
Copy link
Member

bhousel commented Jan 19, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants