schenkerian

0.17.2 • Public • Published

CircleCI Code Climate

HTML Schenkerian analyzer

Greenkeeper badge

Schenkerian analysis is a method of musical analysis by interpreting the underlying structure of a tonal work and to help reading the score according to that structure.

This library is that, but for HTML built on top of Natural Node which includes term frequency, string similarities, and tokenizing. Given most webpages (attempt) to use the semantics of HTML, it takes into account not only term frequency, but the weight of an HTML tag, placement in document, and other useful forms of denoting significance (like Open Graph).

Install

$ npm install schenkerian --save

Usage

var analyze = require('schenkerian')
 
analyze({
  url: 'http://dustindiaz.com',
  body: '<html>...</html>' // optional. if absent, the module will `request` the given webpage
})
.then(function (result) {
  console.log(result)
})

output

{
"totalWords": 637,
"permalink": "http://dustindiaz.com/",
"title": "Dustin Diaz",
"relevance": [
    {
      "word": "javascript",
      "score": 1.074,
      "count": 47
    },
    {
      "word": "ender",
      "score": 0.571,
      "count": 25
    },
    {
      "word": "follow",
      "score": 0.228,
      "count": 10
    },
    {
      "word": "css",
      "score": 0.228,
      "count": 10
    },
    {
      "word": "qwery tiny selector",
      "score": 0.14,
      "count": 3
    },
    {
      "word": "open submodule library",
      "score": 0.14,
      "count": 3
    },
    {
      "word": "js open submodule",
      "score": 0.14,
      "count": 3
    },
    {
      "word": "ender js open",
      "score": 0.14,
      "count": 3
    },
    {
      "word": "mvc framework node",
      "score": 0.14,
      "count": 3
    },
    {
      "word": "tiny selector engine",
      "score": 0.14,
      "count": 3
    }
  ]
}

Package Sidebar

Install

npm i schenkerian

Weekly Downloads

1

Version

0.17.2

License

MIT

Unpacked Size

30.8 kB

Total Files

16

Last publish

Collaborators

  • mixtech
  • ded
  • alif
  • chris_at_mix