compromise-align
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published
a plugin for compromise

npm install compromise-align
const nlp = require('compromise')
nlp.extend(require('compromise-align'))
 
let doc = nlp(myNovel)
let html = doc.htmlAlign('the #Adjective of times')
document.querySelector('#myId').innerHTML = html

generate html output to line-up matches in a text, for easy viewing.

Demo

Usage

in terms of CSS styling, it does most of the layout, and tags the middle text as .matchText. You can style it however you'd like.

the method returns html-strings by default, but the library uses Jason Miller's htm library so you can return React Components, or anything:

doc.htmlAlign(
  {},
  {
    bind: React.createElement,
  }
)

work-in-progress

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i compromise-align

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

31.5 kB

Total Files

6

Last publish

Collaborators

  • spencermountain