forked from MapComplete/MapComplete
Add test
This commit is contained in:
parent
a44a04a79d
commit
e5be391a00
1 changed files with 9 additions and 1 deletions
|
@ -361,7 +361,7 @@ export default class NameSuggestionIndex {
|
|||
return nsi.generateMappings(key, tags, country, center, options)
|
||||
}
|
||||
|
||||
private static readonly brandPrefix = ["name", "alt_name", "operator", "brand"] as const
|
||||
private static readonly brandPrefix = ["name", "alt_name", "operator", "brand", "official_name"] as const
|
||||
|
||||
/**
|
||||
* An NSI-item might have tags such as `name=X`, `alt_name=brand X`, `brand=X`, `brand:wikidata`, `shop=Y`, `service:abc=yes`
|
||||
|
@ -370,6 +370,14 @@ export default class NameSuggestionIndex {
|
|||
* This method is a heuristic which attempts to move all the brand-related tags into an `or` but still requiring the `shop` and other tags
|
||||
*
|
||||
* (More of an extension method on NSIItem)
|
||||
*
|
||||
* const item = {
|
||||
* displayName: "test",
|
||||
* id: "test",
|
||||
* locationSet: {include: ["BE"],exclude: []},
|
||||
* tags: {name:"XYZ", brand:"XYZ", alt_name: "ABC",official_name:"Association Brusselse Chou"}
|
||||
* }
|
||||
* NameSuggestionIndex.asFilterTags(item) // => {or: ["alt_name=ABC", "brand=XYZ","name=XYZ","official_name=Association Brusselse Chou"]}
|
||||
*/
|
||||
static asFilterTags(
|
||||
item: NSIItem
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue