name-suggestion-index icon indicating copy to clipboard operation
name-suggestion-index copied to clipboard

Document matching algorithm

Open brawer opened this issue 2 years ago • 2 comments

Is there a description of the matching algorithm that NSI implementations (ie. consumers of the NSI data file) should implement? Specifically, what checks should be executed in what order (if order matters, not sure about that). If no such docs exist yet, would it make sense to write such a doc?

A test suite would be great too, to help implementations making sure they’re behaving correctly.

brawer avatar Aug 09 '22 14:08 brawer

there is a test suite: https://github.com/osmlab/name-suggestion-index/blob/main/tests/matcher.test.js

I agree it would be a good idea to document better how it works. Im probably the only person who understands it 😢

bhousel avatar Aug 09 '22 18:08 bhousel

I also noticed this testcase too, but sometimes I have to write a new entry and fill it with test data, then run build.

e.g. I test Brand Name with brand.name and brand-name for those common syntax not documented in https://github.com/osmlab/name-suggestion-index/wiki/Contributing#matchnamesmatchtags-optional

(Maybe because of my lack of understanding of match mechanism)

And I wish a fast way to test only a paragraph of text, or only in 1file, because every time manual run test build on all file need about 1-2 min.

LaoshuBaby avatar Aug 09 '22 18:08 LaoshuBaby