How to use retext - 1 common examples

To help you get started, we’ve selected a few retext examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github magda-io / magda / magda-web-client / src / Components / Dataset / MetadataExtraction / extractKeywords.ts View on Github external
return new Promise(async (resolve, reject) => {
        retext()
            .use(keywords, {
                maximum
            })
            .process(text, done);

        function done(err, file) {
            if (err) throw err;
            let keyphrases: string[] = [];
            file.data.keyphrases.forEach(function(phrase) {
                keyphrases.push(phrase.matches[0].nodes.map(toString).join(""));
            });
            resolve(keyphrases);
        }
    });
}

retext

natural language processor powered by plugins part of the unified collective

MIT
Latest version published 1 year ago

Package Health Score

59 / 100
Full package analysis

Popular retext functions