Skip to content

Commit

Permalink
Avoid false positives
Browse files Browse the repository at this point in the history
  • Loading branch information
eliottvincent committed Feb 12, 2025
1 parent 948fb84 commit 9e53999
Show file tree
Hide file tree
Showing 4 changed files with 229 additions and 208 deletions.
2 changes: 1 addition & 1 deletion lib/parser/emailparser.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class EmailParser {

createEmail(fragmentDTOs) {
let fragments = [];

fragmentDTOs.reverse().forEach((fragment) => {
fragments.push(new Fragment(
this.stringReverse(fragment.lines.join("\n")).replace(/^\n/g, ''),
Expand Down
3 changes: 1 addition & 2 deletions lib/regex.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class RegexList {
/^\s*(Op\s[\s\S]+?\n?schreef[\s\S]+:)$/m, // Il DATE, schreef NAME <EMAIL>:
/^\s*((W\sdniu|Dnia)\s[\s\S]+?(pisze|napisał(\(a\))?):)$/mu, // W dniu DATE, NAME <EMAIL> pisze|napisał:
/^\s*(Den\s.+\s\n?skrev\s.+:)$/m, // Den DATE skrev NAME <EMAIL>:
/^\s*(pe\s.+\s.+\n?kirjoitti:)$/m, // pe DATE NAME <EMAIL> kirjoitti:
/^\s*(pe\s.+\s.+\n?kirjoitti:)$/m, // pe DATE NAME <EMAIL> kirjoitti:
/^\s*(Am\s.+\sum\s.+\s\n?schrieb\s.+:)$/m, // Am DATE um TIME schrieb NAME:
/^([\s\S]+)$/m, // > 在 DATE, TIME, NAME 写道:
/^(20[0-9]{2}\..+\s:)$/m, // DATE TIME NAME 작성:
Expand All @@ -53,7 +53,6 @@ class RegexList {
/^\s*-{2,4}$/, // Separator
/^\s*_{2,4}$/, // Separator
/^-- $/, // Separator
/^-- \s*.+$/, // Separator
/^\+{2,4}$/, // Separator
/^\={2,4}$/, // Separator
/^________________________________$/, // Separator
Expand Down
10 changes: 10 additions & 0 deletions test/fixtures/email_not_a_signature_2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Hello,

I'm writing you because of:
-- first point needs to be checked
-- second point needs to be checked
-- and also third point needs to be checked

I hope you can check it

Thanks!
Loading

0 comments on commit 9e53999

Please sign in to comment.