Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added Email normalization preprocessors

  • Loading branch information...
commit e7efd64d1f9fc7e3a10b65060207a765533d55eb 1 parent dc9ef51
@ahmedkotb authored
Showing with 17 additions and 0 deletions.
  1. +17 −0 smart_email/src/preprocessors/EmailAddressesNormalization.java
View
17 smart_email/src/preprocessors/EmailAddressesNormalization.java
@@ -0,0 +1,17 @@
+package preprocessors;
+
+import general.Email;
+
+public class EmailAddressesNormalization implements Preprocessor {
+
+ private static final String ADDRESS_TAG = " EMAILADDR ";
+
+ private static final String EMAIL_REGEX = ".+\\@.+\\..+";
+
+ @Override
+ public void apply(Email email) {
+ email.setSubject(email.getSubject().replaceAll(EMAIL_REGEX, ADDRESS_TAG));
+ email.setContent(email.getContent().replaceAll(EMAIL_REGEX, ADDRESS_TAG));
+ }
+
+}
Please sign in to comment.
Something went wrong with that request. Please try again.