Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
compromise-paragraphs
Advanced tools
npm install compromise-paragraphs
let str = `What's with these homies dissin' my girl? Why do they gotta front?
What did we ever do to these guys that made them so violent?
Woo-hoo, but you know I'm yours.
Woo-hoo, and I know you're mine.
Woo-hoo, and that's for all time
`
let doc = nlp(str).paragraphs()
doc.length
// 3
doc.json(options)
/*[
{text:'What's with these ...', sentences:[{},{}]}
{text:'What did we ever ...', sentences:[{}]}
]*/
// get the second paragraph
doc.eq(1).text()
// 'What did we ever ...'
// get the first two sentences of the first paragraph
doc
.first()
.sentences()
.slice(0, 2)
This is a tentative implementation of .paragraphs()
and associated methods, for compromise.
This is tricky because a sentence is a top-level structure to compromise, (and english grammar!), and combining sentences together would have some consequences about grammatical tags.
Instead, this plugin is a (partially-complete) wrapper for sentence objects, so that you can call things like .text()
and .json()
on a paragraph, but then drop back down to .sentences()
after, and work as normal.
The term objects passed into .paragraphs()
are mutable, so they will actually change when you transform them:
let doc = nlp(str).paragraphs()
doc = doc.filter(p => {
return p.has('#Determiner guys')
})
// What did we ever do to these guys that made them so violent?
outputs:
matches:
selectors:
accessors:
loops:
MIT
10.1.0
.value()
methods.random()
method.lessThan()
, .greaterThan()
, .equalTo()
methods_ffix
syntaxtag()
supports a sequence of tags for a sequence of terms#Adverb{2,4}
.before()
and .after()
match methods.lexicon()
method for many-lexicons concept.replaceWith()
method to a 'keyTags' booleanFAQs
plugin for nlp-compromise
The npm package compromise-paragraphs receives a total of 340 weekly downloads. As such, compromise-paragraphs popularity was classified as not popular.
We found that compromise-paragraphs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.