-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dedublicate #3
base: master
Are you sure you want to change the base?
Dedublicate #3
Conversation
@@ -0,0 +1,201 @@ | |||
'use strict'; | |||
/* | |||
* From: https://github.com/sjhorn/node-minhash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
используй это, а не тяни свой недофорк
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ну или вынести в реальный форк
"minhash": "github:name/forkname",
И сделай гит пулл из мастера (только не проеби мои изменения) |
ок |
@@ -0,0 +1,201 @@ | |||
'use strict'; | |||
/* | |||
* From: https://github.com/sjhorn/node-minhash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ну или вынести в реальный форк
"minhash": "github:name/forkname",
const { shingles, minhash } = require('../deduplicator/minhash'); | ||
const expirationTime = 20 * 60 * 60 * 1000; // 20h | ||
|
||
class SelfCleaningMsgMap extends Map { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Composition vs. Inheritance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Предлагаю не наследовать, а заюзать инстанс Map
constructor(iterable) {
this.map = new Map()
// ...
}
has(msg) {
return this.map.has(msg.message_id)
}
commands/publishVacancy.js
Outdated
@@ -9,10 +9,11 @@ const deleteCommandMessage = require("../utils/command_traces_cleaner").default; | |||
|
|||
const keywords = new Set(["в канал"]); | |||
const replyText = "Вакансия опубликована в " + process.env.APP_TELEGRAM_CHANNEL; | |||
const storage = require('../storage').storage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe
const { storage } = require('../storage')
и может отсортировать строчки?
что-то вроде: все require/import вверху файла
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) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
template literals?
const replyText = "Кажется, еще не прошло 24 часов с момомента последней публикации этой вакансии"; | ||
|
||
async function check(msg) { | ||
console.log("dedublicator"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Мб заюзать debug ?
No description provided.