Exclude models for non-stable versions [ci skip]

This commit is contained in:
ines 2018-07-10 13:44:55 +02:00
parent 3dfc7f86be
commit 71bfc92913

View File

@ -57,7 +57,7 @@ export default function(repo) {
},
orderedCompat() {
return Object.keys(this.compat)
.filter(v => !v.includes('a') && !v.includes('dev') && !v.includes('rc'));
.filter(v => this.$_isStableVersion(v));
},
hasAccuracy() {
return this.uas || this.las || this.tags_acc || this.ents_f || this.ents_p || this.ents_r;
@ -98,8 +98,8 @@ export default function(repo) {
},
$_getLatestVersion(modelId) {
for (let [spacy_v, models] of Object.entries(this.compat)) {
if (models[modelId]) {
for (let [version, models] of Object.entries(this.compat)) {
if (this.$_isStableVersion(version) && models[modelId]) {
return models[modelId][0];
}
}
@ -118,6 +118,14 @@ export default function(repo) {
return `${nKeys} keys, ${nVectors} unique vectors (${width} dimensions)`;
},
/**
* Hacky check if a version number is stable and not alpha,
* dev or a release candidate
*/
$_isStableVersion(v) {
return !v.includes('a') && !v.includes('b') && !v.includes('dev') && !v.includes('rc');
},
/**
* Abbreviate a number, e.g. 14249930 --> 14.25m.
* @param {number|string} num - The number to convert.