Dedublicate - #3
Open
imevro wants to merge 3 commits into
Open
Conversation
imevro
commented
Jan 12, 2018
| @@ -0,0 +1,201 @@ | |||
| 'use strict'; | |||
| /* | |||
| * From: https://github.com/sjhorn/node-minhash | |||
Contributor
Author
There was a problem hiding this comment.
используй это, а не тяни свой недофорк
Member
There was a problem hiding this comment.
Ну или вынести в реальный форк
"minhash": "github:name/forkname",
Contributor
Author
|
И сделай гит пулл из мастера (только не проеби мои изменения) |
Contributor
|
ок |
sergeysova
requested changes
Jan 12, 2018
| @@ -0,0 +1,201 @@ | |||
| 'use strict'; | |||
| /* | |||
| * From: https://github.com/sjhorn/node-minhash | |||
Member
There was a problem hiding this comment.
Ну или вынести в реальный форк
"minhash": "github:name/forkname",
| const { shingles, minhash } = require('../deduplicator/minhash'); | ||
| const expirationTime = 20 * 60 * 60 * 1000; // 20h | ||
|
|
||
| class SelfCleaningMsgMap extends Map { |
Member
There was a problem hiding this comment.
Предлагаю не наследовать, а заюзать инстанс Map
constructor(iterable) {
this.map = new Map()
// ...
}
has(msg) {
return this.map.has(msg.message_id)
}
sergeysova
reviewed
Jan 12, 2018
|
|
||
| const keywords = new Set(["в канал"]); | ||
| const replyText = "Вакансия опубликована в " + process.env.APP_TELEGRAM_CHANNEL; | ||
| const storage = require('../storage').storage; |
Member
There was a problem hiding this comment.
maybe
const { storage } = require('../storage')и может отсортировать строчки?
что-то вроде: все require/import вверху файла
sergeysova
reviewed
Jan 12, 2018
| const minhashval = smlrty(minhash, minhashMsg); | ||
| const jaccard = jaccardIndex(shingles, shinglesMsg); | ||
| console.log( "Minhash similarity is "+minhashval+" (%d%% similar)", Math.round(minhashval * 100) ); | ||
| console.log( "Jaccard index is "+jaccard+" (%d%% similar)", Math.round(jaccard * 100) ); |
sergeysova
requested changes
Jan 30, 2018
| const replyText = "Кажется, еще не прошло 24 часов с момомента последней публикации этой вакансии"; | ||
|
|
||
| async function check(msg) { | ||
| console.log("dedublicator"); |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.