Commit graph

232 commits

Author SHA1 Message Date
Bryan Housel
58bfd675d1 Use locale-aware sorting everywhere, npm run build
Before, sort depended on the locale of the computer running the script
(re: #4850, #4871)
2021-02-05 10:20:21 -05:00
Bryan Housel
eeaf81aec1 Rename sort -> sort_object
(preparing to introduce more locale-specific sorting)
2021-02-05 09:43:50 -05:00
Bryan Housel
3623b09050 Avoid potentially dangerous regular expressions
good overview:  https://stackoverflow.com/a/43872595
2021-02-04 17:18:42 -05:00
Bryan Housel
aeeeaf8c36 fix healthcare tag assignment, npm run wikidata, npm run dist 2021-02-04 13:06:44 -05:00
Bryan Housel
0050022e35 Move clinics, hospitals from the brands tree to the operators tree
(re: #4890)
2021-02-04 12:00:52 -05:00
Bryan Housel
93ae4a408c Add templateInclude/templateExclude for UPS mailboxes
(closes #4866)
2021-01-19 17:06:08 -05:00
Bryan Housel
2b2a60d47f Exclude name:pronunciation
I don't think we'd include these in NSI anyway, but it is a thing..
2021-01-19 12:12:21 -05:00
Bryan Housel
bc0425f29e Add primary/alternate names to iD preset search terms 2021-01-18 14:26:17 -05:00
Bryan Housel
c05dd74a25 Matcher refactor, many improvements
- Separate caches for primary/alternate names
- This lets us perform a single indexing pass and return more relevant name matches
- Add primary/alternate name tag patterns to trees.json
- match() returns a result object that sorts primary before alternate
- More speed improvements
- More tests
2021-01-15 12:01:12 -05:00
Bryan Housel
023401cea0 Force localeCompare to use en-US locale for sorting consistency 2021-01-04 13:25:30 -05:00
Bryan Housel
504a8a2a30 Force newline '\n' on the end of all the files
There are good reasons for files to end in a newline, and text editors keep trying to add it.
However `stringify` doesn't add it by default so this has resulted in `npm run
build` introducing a lot of churn in the files.
Hoping that this change avoids future churn.
2021-01-04 10:56:19 -05:00
Bryan Housel
be84f4ac9e Can't use require for path relative to project root 2020-12-30 17:24:36 -05:00
Bryan Housel
175ef9964d Create a convenience function for writing files with metadata 2020-12-30 17:01:40 -05:00
Bryan Housel
a2b53cbf9c Always build the location index, check for invalid resolved features 2020-12-30 00:56:24 -05:00
Bryan Housel
8c8ad0551a Correctly handle the dissolved file now with meta property 2020-12-29 11:32:10 -05:00
Bryan Housel
84580dd07c Add metadata to all dist files
This will let us know when files were generated, which is needed for #4794
2020-12-29 10:41:39 -05:00
Bryan Housel
6aabe685e5 Add jest for testing, create test for simplify
Also remove the validate.js file, since validation happens on index build
(re #4788)
2020-12-23 10:18:45 -05:00
Bryan Housel
8d5a8a220b Have build_wikidata.js script fix broken *:wikipedia tags
(closes #4717)
2020-12-22 09:43:06 -05:00
Bryan Housel
fcf6657f64 Skip the deprecation checks for flag subject too
(closes #4804)
2020-12-17 14:20:03 -05:00
Bryan Housel
677187557d Skip the deprecation checks for flags
(closes #4804)
2020-12-17 11:36:31 -05:00
Bryan Housel
32b51d3964 Raise error if a file doesn't have the right file extension 2020-12-15 11:55:11 -05:00
Bryan Housel
03992a5430 npm run build 2020-12-14 10:38:32 -05:00
Bryan Housel
2cc5cb939b Remove names from post offices, but preserve edge cases in alt_name
- "Speedy" in Bulgaria
- "Kantor Pos" in Indonesia
- "Barid Al-Maghrib" in Morocco
(re: #4783)
2020-12-09 10:26:28 -05:00
Bryan Housel
01d4d3fa05 Rename index.json -> nsi.json, match_groups.json -> matchGroups.json
Trying to be less confusing, more consistent
2020-12-08 12:23:45 -05:00
Bryan Housel
834668725e Don't generate josm preset menu groups for empty categories
(re: https://github.com/osmlab/name-suggestion-index/issues/4780#issuecomment-740003717)
2020-12-07 11:22:10 -05:00
Bryan Housel
392a8fbf14 Watch out for non-string locationset values
(closes #4776)
2020-12-05 16:26:43 -05:00
Bryan Housel
a15ed282b0 Fix bug, so values get josm preset menu groups, npm run dist 2020-12-05 12:19:29 -05:00
Bryan Housel
20138c0d69 Exclude dissolved and missing wikidata, npm run dist 2020-12-05 00:13:33 -05:00
Bryan Housel
281bf2bc1f Generate iD Presets
(closes #4718)
2020-12-04 23:59:33 -05:00
Bryan Housel
0a5881c3e1 Rename some preset generation things, depend on schema builder
(re: #4718)
2020-12-04 11:00:18 -05:00
Bryan Housel
846155005d Keep the flagpole file sorted by country code
(closes #4761)
2020-12-03 17:02:04 -05:00
Bryan Housel
94f8420271 Remove the hacky flag import code 2020-12-03 16:43:53 -05:00
Bryan Housel
43c4a83f47 Support flags in enLabelForQID() 2020-12-02 15:08:44 -05:00
Bryan Housel
61cb87beab Import all the national flags 2020-12-02 13:01:15 -05:00
Bryan Housel
fdb8c48e6c Don't use a special redirect to generate thumbnails for SVG images
(closes #4758)
2020-12-02 10:37:25 -05:00
Bryan Housel
77f0f8e2f4 Grab P18 "image" instead of P154 "logo image" (for flags)
(closes #4745)
2020-12-02 09:25:38 -05:00
Bryan Housel
78c48c4ae6 Don't include all country values in taginfo.json 2020-12-01 17:29:41 -05:00
Bryan Housel
5152520030 Avoid copying operator:type tag -> brand:type/name:type 2020-12-01 16:54:47 -05:00
Bryan Housel
3e6cd9d295 Add a flags tree
(re: #4745)
2020-12-01 13:31:02 -05:00
Bryan Housel
b16cc5f415 Collect amenity in combination with network
(for #4736)
2020-12-01 10:18:11 -05:00
Bryan Housel
69b4390e1b Fix the validator for genericWords.json 2020-11-26 15:51:04 -05:00
Bryan Housel
715f0af431 Finish simplifying config files
(closes #4733)
2020-11-25 17:39:45 -05:00
Bryan Housel
125a4109f0 Read and write all trees at once, use tree metadata to decide main tag
(also if P31 "instance of" is missing, set it to Q43229 "organization")
(closes #4726)
2020-11-25 17:26:02 -05:00
Bryan Housel
94d4688aa9 More config file changes, npm run build
(re: #4733)
2020-11-25 15:01:17 -05:00
Bryan Housel
ef3f1e74c4 Config files changes - move more logic from scripts to config
(re: #4733)
2020-11-25 14:26:28 -05:00
Bryan Housel
87b45682fb Restore some allowable characters in osm tags
(shouldn't have copypasted the regex in e14c98ac)
2020-11-25 10:40:27 -05:00
Bryan Housel
b27431fa8f Remove website tags in build
`website` tag should be the website for that location, not the website for the brand..
2020-11-21 11:14:11 -05:00
Bryan Housel
6a0812c700 npm run wikidata / npm run dist
(This is the first run post #4716, so many `*:wikipedia` tags updated)
2020-11-20 12:51:15 -05:00
Bryan Housel
41802cb26c Have build_wikidata.js lookup missing *:wikipedia tags
(closes #4716)
2020-11-20 11:57:04 -05:00
Bryan Housel
e14c98ac64 Don't trim the zero width chars when cleaning tags before save
But do clean them when creating the simplified strings used by the matcher and idgen
(closes #4715)
2020-11-19 11:44:44 -05:00