Last active
November 6, 2023 14:08
-
-
Save josue1dario2/9311385dbee147c3c094f062f37ccf57 to your computer and use it in GitHub Desktop.
Test library compromise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const datos = require('./datos.json'); | |
const nlp = require('compromise'); | |
const expresionRegular = /(\d+\s*\"|\d+[A-Za-z]+|\d+\s*\w+|[A-Za-z]\d+|A54)/gi; | |
let lista = []; | |
datos.entry.map((obj, index) => { | |
if (index < 5) { | |
const doc = nlp(obj.title.__cdata); | |
doc.remove('#Determiner'); | |
doc.remove('#Pronoun'); | |
doc.remove('#Conjunction'); | |
doc.remove('#Preposition'); | |
const match = doc.text().match(expresionRegular); | |
if (match) { | |
lista.push(match); | |
} | |
} | |
}); | |
console.log(lista); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment