You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sa...@apache.org on 2012/03/19 05:14:32 UTC
svn commit: r1302269 [5/5] - in /lucene/dev/branches/branch_3x: ./ lucene/
lucene/core/ lucene/core/src/java/org/apache/lucene/analysis/standard/
lucene/core/src/java/org/apache/lucene/analysis/standard/std34/
lucene/core/src/test/org/apache/lucene/ana...
Modified: lucene/dev/branches/branch_3x/lucene/core/src/test/org/apache/lucene/analysis/TestUAX29URLEmailTokenizer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/core/src/test/org/apache/lucene/analysis/TestUAX29URLEmailTokenizer.java?rev=1302269&r1=1302268&r2=1302269&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/core/src/test/org/apache/lucene/analysis/TestUAX29URLEmailTokenizer.java (original)
+++ lucene/dev/branches/branch_3x/lucene/core/src/test/org/apache/lucene/analysis/TestUAX29URLEmailTokenizer.java Mon Mar 19 04:14:31 2012
@@ -347,6 +347,31 @@ public class TestUAX29URLEmailTokenizer
(emailAnalyzer, randomTextWithEmails, emails);
}
+ public void testMailtoSchemeEmails () throws Exception {
+ // See LUCENE-3880
+ BaseTokenStreamTestCase.assertAnalyzesTo(a, "mailto:test@example.org",
+ new String[] {"mailto", "test@example.org"},
+ new String[] { "<ALPHANUM>", "<EMAIL>" });
+
+ // TODO: Support full mailto: scheme URIs. See RFC 6068: http://tools.ietf.org/html/rfc6068
+ BaseTokenStreamTestCase.assertAnalyzesTo
+ (a, "mailto:personA@example.com,personB@example.com?cc=personC@example.com"
+ + "&subject=Subjectivity&body=Corpusivity%20or%20something%20like%20that",
+ new String[] { "mailto",
+ "personA@example.com",
+ // TODO: recognize ',' address delimiter. Also, see examples of ';' delimiter use at: http://www.mailto.co.uk/
+ ",personB@example.com",
+ "?cc=personC@example.com", // TODO: split field keys/values
+ "subject", "Subjectivity",
+ "body", "Corpusivity", "20or", "20something","20like", "20that" }, // TODO: Hex decoding + re-tokenization
+ new String[] { "<ALPHANUM>",
+ "<EMAIL>",
+ "<EMAIL>",
+ "<EMAIL>",
+ "<ALPHANUM>", "<ALPHANUM>",
+ "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>" });
+ }
+
public void testURLs() throws Exception {
Reader reader = null;
String randomTextWithURLs;