Port of mailgun/talon (signature detection in mails) from Python to JavaScript.
This can be used to extract and strip signature from mail messages, allowing safer automatic parsing for example.
npm install --save talon
var talon = require("talon");
var extractSignature = talon.signature.bruteforce.extractSignature;
var message = "Wow. Awesome!\n--\nBob Smith";
console.log(extractSignature(message));
expected output:
{ text: 'Wow. Awesome!', signature: '--\nBob Smith' }
In the original library, there are multiple ways of extracting signatures. Here is implemented only one of the available methods, but I chose to keep the same namespace structure.
- The bruteforce method of extracting signature
- Added French support
- Everything else, including:
- machine-learning way of extracting signature
- quotations extraction
- We'll need quotations handling very soon, so it will land fast
- The machine-learning thing is really not a priority