From f562a8a0dcaac706036e7a80ddb5932a7602a74c Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Tue, 17 Jan 2012 02:20:24 +0000 Subject: [PATCH] LUCENE-3700: optionally support naist-jdic for kuromoji git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1232268 13f79535-47bb-0310-9956-ffa450edef68 --- modules/analysis/kuromoji/build.xml | 10 +++++++++- .../analysis/kuromoji/TestKuromojiTokenizer.java | 15 ++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/modules/analysis/kuromoji/build.xml b/modules/analysis/kuromoji/build.xml index 7358886d4ce..6983a341eb2 100644 --- a/modules/analysis/kuromoji/build.xml +++ b/modules/analysis/kuromoji/build.xml @@ -25,10 +25,18 @@ + + - + + + diff --git a/modules/analysis/kuromoji/src/test/org/apache/lucene/analysis/kuromoji/TestKuromojiTokenizer.java b/modules/analysis/kuromoji/src/test/org/apache/lucene/analysis/kuromoji/TestKuromojiTokenizer.java index 14e7eb47065..f7514e9f449 100644 --- a/modules/analysis/kuromoji/src/test/org/apache/lucene/analysis/kuromoji/TestKuromojiTokenizer.java +++ b/modules/analysis/kuromoji/src/test/org/apache/lucene/analysis/kuromoji/TestKuromojiTokenizer.java @@ -78,12 +78,17 @@ public class TestKuromojiTokenizer extends BaseTokenStreamTestCase { ); } + /* Note this is really a stupid test just to see if things arent horribly slow. + * ideally the test would actually fail instead of hanging... + */ public void testDecomposition5() throws Exception { - assertAnalyzesTo(analyzer, "くよくよくよくよくよくよくよくよくよくよくよくよくよくよくよくよくよくよくよくよ", - new String[] { "くよくよ", "くよくよ", "くよくよ", "くよくよ", "くよくよ", "くよくよ", "くよくよ", "くよくよ", "くよくよ", "くよくよ" }, - new int[] { 0, 4, 8, 12, 16, 20, 24, 28, 32, 36}, - new int[] { 4, 8, 12, 16, 20, 24, 28, 32, 36, 40 } - ); + TokenStream ts = analyzer.tokenStream("bogus", new StringReader("くよくよくよくよくよくよくよくよくよくよくよくよくよくよくよくよくよくよくよくよ")); + ts.reset(); + while (ts.incrementToken()) { + + } + ts.end(); + ts.close(); } /** Tests that sentence offset is incorporated into the resulting offsets */