Skip to content

Commit

Permalink
Improved keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
Ealenn committed Dec 9, 2016
1 parent 80131ce commit c914960
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 59 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"author": "Ealen",
"license": "ISC",
"dependencies": {
"density": "^0.1.0",
"electron": "^1.4.10",
"electron-packager": "^8.3.0",
"electron-prebuilt": "^1.4.10",
Expand All @@ -31,6 +30,7 @@
"psi": "^2.0.4",
"request": "^2.79.0",
"title-case": "^2.1.0",
"topick": "^0.1.3",
"w3c-css": "^2.0.0",
"w3cjs": "^0.3.0",
"wappalyzer": "^2.0.4"
Expand Down
45 changes: 0 additions & 45 deletions stopwords.json

This file was deleted.

12 changes: 7 additions & 5 deletions view/Website.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ class Website{
}

/** KEYWORDS
* @return {array} JSon https://www.npmjs.com/package/density =
* [{"word": "world","count": 1},{"word": "hello","count": 2}]
* @return {array} JSon
* @param {Requester~requestCallback} callback function(data)
*/
getKeywords(){
var density = require('density');
return density(this.html).getDensity();
getKeywords(callback){
var Topick = require('topick');
Topick.getKeywords(this.url, {maxNumberOfKeywords:50, minKeywordLength: 4, ngram: { min_count: 5, max_size: 3 }}).then((keywords) => {
callback(keywords);
})
}

/**
Expand Down
5 changes: 3 additions & 2 deletions view/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ $(document).ready(function(){

/* Keyword */
T.addTask('keywords', ()=>{
var ArrayKeyword = Website.getKeywords();
T.finishTask('keywords', {key: ArrayKeyword});
var ArrayKeyword = Website.getKeywords((data)=>{
T.finishTask('keywords', {keyword : data});
});
})

/* Google Search */
Expand Down
8 changes: 2 additions & 6 deletions view/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,17 +175,13 @@ <h3 class="panel-title">Keywords</h3>
<thead>
<tr>
<th>Word</th>
<th>Repeat</th>
</tr>
</thead>
<tbody>
{{#each key}}
{{#ifSup this.count 5}}
{{#each keyword}}
<tr>
<td>{{this.word}}</td>
<td>{{this.count}}</td>
<td>{{this}}</td>
</tr>
{{/ifSup}}
{{/each}}
</tbody>
</table>
Expand Down

0 comments on commit c914960

Please sign in to comment.