pelias-schema 6.3.0 → 6.4.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.github/workflows/push.yml +21 -9
- package/Dockerfile +1 -1
- package/README.md +1 -1
- package/integration/analyzer_peliasIndexOneEdgeGram.js +2 -2
- package/integration/analyzer_peliasPhrase.js +3 -0
- package/package.json +3 -4
- package/punctuation.js +1 -1
- package/settings.js +1 -0
- package/test/fixtures/expected.json +3 -1
- package/test/settings.js +2 -1
- package/.circleci/config.yml +0 -12
@@ -8,8 +8,8 @@ jobs:
|
|
8
8
|
runs-on: ${{ matrix.os }}
|
9
9
|
strategy:
|
10
10
|
matrix:
|
11
|
-
os: [ubuntu-
|
12
|
-
node-version: [
|
11
|
+
os: [ubuntu-20.04]
|
12
|
+
node-version: [12.x, 14.x, 16.x]
|
13
13
|
steps:
|
14
14
|
- uses: actions/checkout@v2
|
15
15
|
- name: Install node.js ${{ matrix.node-version }}
|
@@ -26,8 +26,8 @@ jobs:
|
|
26
26
|
runs-on: ${{ matrix.os }}
|
27
27
|
strategy:
|
28
28
|
matrix:
|
29
|
-
os: [ubuntu-
|
30
|
-
node-version: [
|
29
|
+
os: [ubuntu-20.04]
|
30
|
+
node-version: [12.x, 14.x, 16.x]
|
31
31
|
es-version: [7.6.1]
|
32
32
|
jdk-version: [oraclejdk11]
|
33
33
|
steps:
|
@@ -51,18 +51,30 @@ jobs:
|
|
51
51
|
npm-publish:
|
52
52
|
needs: [unit-tests, integration-tests]
|
53
53
|
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
|
54
|
-
runs-on: ubuntu-
|
54
|
+
runs-on: ubuntu-20.04
|
55
55
|
steps:
|
56
56
|
- uses: actions/checkout@v2
|
57
|
-
- name: Install
|
57
|
+
- name: Install Node.js
|
58
58
|
uses: actions/setup-node@v2-beta
|
59
59
|
with:
|
60
|
-
node-version:
|
60
|
+
node-version: 16.x
|
61
61
|
- name: Run semantic-release
|
62
62
|
env:
|
63
63
|
GH_TOKEN: ${{ secrets.GH_SEMANTIC_RELEASE_TOKEN }}
|
64
64
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
65
65
|
run: |
|
66
|
-
npm install -g npm
|
67
|
-
npm install --production
|
68
66
|
curl "https://raw.githubusercontent.com/pelias/ci-tools/master/semantic-release.sh" | bash -
|
67
|
+
build-docker-images:
|
68
|
+
# run this job if the unit tests passed and the npm-publish job was a success or was skipped
|
69
|
+
# note: github actions won't run a job if you don't call one of the status check functions, so `always()` is called since it evalutes to `true`
|
70
|
+
if: ${{ always() && needs.unit-tests.result == 'success' && (needs.npm-publish.result == 'success' || needs.npm-publish.result == 'skipped') }}
|
71
|
+
needs: [unit-tests, integration-tests, npm-publish]
|
72
|
+
runs-on: ubuntu-20.04
|
73
|
+
steps:
|
74
|
+
- uses: actions/checkout@v2
|
75
|
+
- name: Build Docker images
|
76
|
+
env:
|
77
|
+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
78
|
+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
79
|
+
run: |
|
80
|
+
curl "https://raw.githubusercontent.com/pelias/ci-tools/master/build-docker-images.sh" | bash -
|
package/Dockerfile
CHANGED
@@ -6,7 +6,7 @@ ENV WORKDIR /code/pelias/schema
|
|
6
6
|
WORKDIR ${WORKDIR}
|
7
7
|
|
8
8
|
# copy package.json first to prevent npm install being rerun when only code changes
|
9
|
-
COPY ./package.json ${
|
9
|
+
COPY ./package.json ${WORKDIR}
|
10
10
|
RUN npm install
|
11
11
|
|
12
12
|
# add code from local checkout to image
|
package/README.md
CHANGED
@@ -48,7 +48,7 @@ module.exports.tests.analyze = function(test, common){
|
|
48
48
|
'1:a',
|
49
49
|
'2:a', '2:ab',
|
50
50
|
'3:a', '3:ab', '3:abc',
|
51
|
-
'4:a', '4:ab', '4:abc', '4:abcd', '4:abcde', '4:abcdef',
|
51
|
+
'4:a', '4:ab', '4:abc', '4:abcd', '4:abcde', '4:abcdef',
|
52
52
|
'4:abcdefg', '4:abcdefgh', '4:abcdefghi', '4:abcdefghij'
|
53
53
|
] );
|
54
54
|
assertAnalysis( 'removeAllZeroNumericPrefix', '00001', ['1'] );
|
@@ -69,7 +69,7 @@ module.exports.tests.analyze = function(test, common){
|
|
69
69
|
// remove punctuation (handled by the char_filter)
|
70
70
|
assertAnalysis('punctuation', punctuation.all.join(''), ['0:&', '0:a', '0:an', '0:and', '0:u', '0:un', '0:und'] );
|
71
71
|
assertAnalysis( 'punctuation', 'Hawai‘i', ['0:h', '0:ha', '0:haw', '0:hawa', '0:hawai', '0:hawaii'] );
|
72
|
-
|
72
|
+
assertAnalysis( 'punctuation', '„Tip Top”', ['0:t', '0:ti', '0:tip', '1:t', '1:to', '1:top'] );
|
73
73
|
// ensure that very large grams are created
|
74
74
|
assertAnalysis( 'largeGrams', 'grolmanstrasse', [
|
75
75
|
'0:g', '0:gr', '0:gro', '0:grol', '0:grolm', '0:grolma', '0:grolman', '0:grolmans',
|
@@ -51,6 +51,9 @@ module.exports.tests.analyze = function(test, common){
|
|
51
51
|
assertAnalysis( 'british_american_english', 'town theatre', ['0:town', '1:theatre', '1:theater'] );
|
52
52
|
assertAnalysis( 'british_american_english', 'town theater', ['0:town', '1:theater', '1:theatre'] );
|
53
53
|
|
54
|
+
// remove leading zeros from numeric input
|
55
|
+
assertAnalysis( 'leading_zeros', '01000', ['0:1000'] );
|
56
|
+
assertAnalysis( 'leading_zeros', '09999', ['0:9999'] );
|
54
57
|
|
55
58
|
suite.run( t.end );
|
56
59
|
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "pelias-schema",
|
3
|
-
"version": "6.
|
3
|
+
"version": "6.4.1",
|
4
4
|
"author": "pelias",
|
5
5
|
"description": "Elasticsearch schema files and tooling for Pelias",
|
6
6
|
"homepage": "https://github.com/pelias/schema",
|
@@ -12,8 +12,7 @@
|
|
12
12
|
"create_index": "./bin/create_index",
|
13
13
|
"drop_index": "node scripts/drop_index",
|
14
14
|
"reset_type": "node scripts/reset_type",
|
15
|
-
"update_settings": "node scripts/update_settings"
|
16
|
-
"travis": "npm run test && npm run integration"
|
15
|
+
"update_settings": "node scripts/update_settings"
|
17
16
|
},
|
18
17
|
"repository": {
|
19
18
|
"type": "git",
|
@@ -45,7 +44,7 @@
|
|
45
44
|
"iso3166-1": "^0.5.1",
|
46
45
|
"proxyquire": "^2.0.0",
|
47
46
|
"tap-spec": "^5.0.0",
|
48
|
-
"tape": "^
|
47
|
+
"tape": "^5.0.0"
|
49
48
|
},
|
50
49
|
"pre-commit": [],
|
51
50
|
"release": {
|
package/punctuation.js
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
module.exports.all = [
|
5
5
|
".","`","‘","-","_","=","?","'","|","\"","(",")","{","}","[","]","<",">","*",
|
6
6
|
"#","&","^","$","@","!","~",":",";","+","《","》","—","-",",","。",
|
7
|
-
"、", ":",";","!","·","?","“","”",")","(","【","】","[","]","●"
|
7
|
+
"、", ":",";","!","·","?","„","“","”",")","(","【","】","[","]","●"
|
8
8
|
];
|
9
9
|
|
10
10
|
module.exports.allowed = [
|
package/settings.js
CHANGED
@@ -96,6 +96,7 @@
|
|
96
96
|
"name_synonyms_multiplexer",
|
97
97
|
"icu_folding",
|
98
98
|
"remove_ordinals",
|
99
|
+
"removeAllZeroNumericPrefix",
|
99
100
|
"unique_only_same_position",
|
100
101
|
"notnull",
|
101
102
|
"flatten_graph"
|
@@ -2312,6 +2313,7 @@
|
|
2312
2313
|
"!=>",
|
2313
2314
|
"·=>",
|
2314
2315
|
"?=>",
|
2316
|
+
"„=>",
|
2315
2317
|
"“=>",
|
2316
2318
|
"”=>",
|
2317
2319
|
")=>",
|
@@ -3049,4 +3051,4 @@
|
|
3049
3051
|
},
|
3050
3052
|
"dynamic": "strict"
|
3051
3053
|
}
|
3052
|
-
}
|
3054
|
+
}
|
package/test/settings.js
CHANGED
@@ -159,6 +159,7 @@ module.exports.tests.peliasPhraseAnalyzer = function(test, common) {
|
|
159
159
|
"name_synonyms_multiplexer",
|
160
160
|
"icu_folding",
|
161
161
|
"remove_ordinals",
|
162
|
+
"removeAllZeroNumericPrefix",
|
162
163
|
"unique_only_same_position",
|
163
164
|
"notnull",
|
164
165
|
"flatten_graph"
|
@@ -590,7 +591,7 @@ module.exports.tests.punctuationCharFilter = function(test, common) {
|
|
590
591
|
var char_filter = s.analysis.char_filter.punctuation;
|
591
592
|
t.equal(char_filter.type, 'mapping');
|
592
593
|
t.true(Array.isArray(char_filter.mappings));
|
593
|
-
t.equal(char_filter.mappings.length,
|
594
|
+
t.equal(char_filter.mappings.length, 49);
|
594
595
|
t.end();
|
595
596
|
});
|
596
597
|
};
|
package/.circleci/config.yml
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
version: 2
|
2
|
-
jobs:
|
3
|
-
build:
|
4
|
-
working_directory: /app
|
5
|
-
docker:
|
6
|
-
- image: docker:18.06.1-ce-git
|
7
|
-
steps:
|
8
|
-
- checkout
|
9
|
-
- setup_remote_docker
|
10
|
-
- run:
|
11
|
-
name: Build and push image to Docker Hub
|
12
|
-
command: apk --no-cache add curl bash && curl "https://raw.githubusercontent.com/pelias/ci-tools/master/build-docker-images.sh" | bash -
|