StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics
https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
747 B
33 lines
747 B
'use strict';
|
|
|
|
var defaults = require('./defaults');
|
|
|
|
module.exports = function(file, options) {
|
|
var opts = defaults(options);
|
|
|
|
if (file.data == null) {
|
|
file.data = {};
|
|
}
|
|
|
|
if (typeof opts.excerpt === 'function') {
|
|
return opts.excerpt(file, opts);
|
|
}
|
|
|
|
var sep = file.data.excerpt_separator || opts.excerpt_separator;
|
|
if (sep == null && (opts.excerpt === false || opts.excerpt == null)) {
|
|
return file;
|
|
}
|
|
|
|
var delimiter = sep || opts.delimiters[0];
|
|
if (typeof opts.excerpt === 'string') {
|
|
delimiter = opts.excerpt;
|
|
}
|
|
|
|
// if enabled, get the excerpt defined after front-matter
|
|
var idx = file.content.indexOf(delimiter);
|
|
if (idx !== -1) {
|
|
file.excerpt = file.content.slice(0, idx);
|
|
}
|
|
|
|
return file;
|
|
};
|
|
|