@hebcal/geo-sqlite 4.0.1 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/geo-sqlite v4.0.1 */
1
+ /*! @hebcal/geo-sqlite v4.1.0 */
2
2
  'use strict';
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -549,6 +549,12 @@ async function buildGeonamesSqlite(opts) {
549
549
  periodTo NULL
550
550
  );`);
551
551
  await doFile(logger, db, ILalternate, 'alternatenames', 10, a => {
552
+ const firstchar = a[3][0];
553
+
554
+ if (a[2] === 'he' && (firstchar < '\u05D0' || firstchar > '\u05EA')) {
555
+ a[2] = 'en';
556
+ }
557
+
552
558
  if (a[2] === 'he' || a[2] === 'en') {
553
559
  if (a[2] === 'he') {
554
560
  a[3] = a[3].replace(/‘/g, '׳');
@@ -604,10 +610,19 @@ async function buildGeonamesSqlite(opts) {
604
610
  SELECT g.geonameid, alt.name||', ישראל',
605
611
  alt.name, '', 'ישראל',
606
612
  g.population, g.latitude, g.longitude, g.timezone
607
- FROM geoname g, country c, altnames alt
613
+ FROM geoname g, altnames alt
608
614
  WHERE g.country = 'IL'
609
615
  AND alt.isolanguage = 'he'
610
616
  AND g.geonameid = alt.geonameid
617
+ `, `INSERT INTO geoname_fulltext
618
+ SELECT g.geonameid, alt.name||', '||a1.asciiname||', Israel',
619
+ alt.name, a1.asciiname, 'Israel',
620
+ g.population, g.latitude, g.longitude, g.timezone
621
+ FROM geoname g, admin1 a1, altnames alt
622
+ WHERE g.country = 'IL'
623
+ AND alt.isolanguage = 'en'
624
+ AND g.geonameid = alt.geonameid
625
+ AND g.country||'.'||g.admin1 = a1.key
611
626
  `);
612
627
  db.close();
613
628
  return Promise.resolve(true);
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/geo-sqlite v4.0.1 */
1
+ /*! @hebcal/geo-sqlite v4.1.0 */
2
2
  import Database from 'better-sqlite3';
3
3
  import { Location, Locale } from '@hebcal/core';
4
4
  import '@hebcal/cities';
@@ -537,6 +537,12 @@ async function buildGeonamesSqlite(opts) {
537
537
  periodTo NULL
538
538
  );`);
539
539
  await doFile(logger, db, ILalternate, 'alternatenames', 10, a => {
540
+ const firstchar = a[3][0];
541
+
542
+ if (a[2] === 'he' && (firstchar < '\u05D0' || firstchar > '\u05EA')) {
543
+ a[2] = 'en';
544
+ }
545
+
540
546
  if (a[2] === 'he' || a[2] === 'en') {
541
547
  if (a[2] === 'he') {
542
548
  a[3] = a[3].replace(/‘/g, '׳');
@@ -592,10 +598,19 @@ async function buildGeonamesSqlite(opts) {
592
598
  SELECT g.geonameid, alt.name||', ישראל',
593
599
  alt.name, '', 'ישראל',
594
600
  g.population, g.latitude, g.longitude, g.timezone
595
- FROM geoname g, country c, altnames alt
601
+ FROM geoname g, altnames alt
596
602
  WHERE g.country = 'IL'
597
603
  AND alt.isolanguage = 'he'
598
604
  AND g.geonameid = alt.geonameid
605
+ `, `INSERT INTO geoname_fulltext
606
+ SELECT g.geonameid, alt.name||', '||a1.asciiname||', Israel',
607
+ alt.name, a1.asciiname, 'Israel',
608
+ g.population, g.latitude, g.longitude, g.timezone
609
+ FROM geoname g, admin1 a1, altnames alt
610
+ WHERE g.country = 'IL'
611
+ AND alt.isolanguage = 'en'
612
+ AND g.geonameid = alt.geonameid
613
+ AND g.country||'.'||g.admin1 = a1.key
599
614
  `);
600
615
  db.close();
601
616
  return Promise.resolve(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebcal/geo-sqlite",
3
- "version": "4.0.1",
3
+ "version": "4.1.0",
4
4
  "author": "Michael J. Radwin (https://github.com/mjradwin)",
5
5
  "keywords": [
6
6
  "hebcal"
@@ -65,6 +65,6 @@
65
65
  "eslint-config-google": "^0.14.0",
66
66
  "jsdoc": "^3.6.10",
67
67
  "jsdoc-to-markdown": "^7.1.1",
68
- "rollup": "^2.69.0"
68
+ "rollup": "^2.69.1"
69
69
  }
70
70
  }