No, you're not missing anything. :) That JavaMail API is good for getting the whole email, but you then need to chop it up with your EmailAnalyzer, so you're doing the right thing.
Otis ----- Original Message ---- From: Michael J. Prichard <[EMAIL PROTECTED]> To: java-user@lucene.apache.org Sent: Saturday, July 29, 2006 2:51:59 PM Subject: Re: EMAIL ADDRESS: Tokenize (i.e. an EmailAnalyzer) Hasan Diwan wrote: > Michael: > > On 7/28/06, Michael J. Prichard <[EMAIL PROTECTED]> wrote: > >> Howdy....not sure if anyone else wants this but here is my first attempt >> at writing an analyzer for an email address...modifications, updates, >> fixes welcome. > > > Why reinvent the wheel? See > http://java.sun.com/products/javamail/javadocs/javax/mail/internet/InternetAddress.html#parse(java.lang.String) > > > and use as: > > InternetAddress valid = InternetAddress.parse(string)[0]; // far > simpler than rewriting it > i dont see where i can break an email address into simpler pieces for tokens. i use javamail when parsing the message and then pulling the email using InternetAddress. I don't see where I can break an email address like [EMAIL PROTECTED] into "[EMAIL PROTECTED]", "john", "foo.com", "foo" and "com" without splitting it. Am I missing something? Thanks! Michael --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]