From 842680f15d93bf05c79661ad8d5ab1d9aea551a3 Mon Sep 17 00:00:00 2001 From: Shalin Shekhar Mangar Date: Wed, 30 Jul 2008 08:24:07 +0000 Subject: [PATCH] Removed call to SolrCore.log and SolrCore import. Replaced reference to java.io.File with File git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@680936 13f79535-47bb-0310-9956-ffa450edef68 --- .../solr/analysis/SynonymFilterFactory.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/java/org/apache/solr/analysis/SynonymFilterFactory.java b/src/java/org/apache/solr/analysis/SynonymFilterFactory.java index fca4d5a6537..41cee1f2cac 100644 --- a/src/java/org/apache/solr/analysis/SynonymFilterFactory.java +++ b/src/java/org/apache/solr/analysis/SynonymFilterFactory.java @@ -21,14 +21,12 @@ import org.apache.lucene.analysis.Token; import org.apache.lucene.analysis.TokenStream; import org.apache.solr.common.ResourceLoader; import org.apache.solr.common.util.StrUtils; -import org.apache.solr.core.SolrCore; import org.apache.solr.util.plugin.ResourceLoaderAware; import java.io.File; import java.io.IOException; import java.io.Reader; import java.io.StringReader; -import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -37,7 +35,7 @@ import java.util.Map; * @version $Id$ */ public class SynonymFilterFactory extends BaseTokenFilterFactory implements ResourceLoaderAware { - + public void inform(ResourceLoader loader) { String synonyms = args.get("synonyms"); @@ -53,7 +51,7 @@ public class SynonymFilterFactory extends BaseTokenFilterFactory implements Reso if (synonyms != null) { List wlist=null; try { - File synonymFile = new java.io.File(synonyms); + File synonymFile = new File(synonyms); if (synonymFile.exists()) { wlist = loader.getLines(synonyms); } else { @@ -67,9 +65,6 @@ public class SynonymFilterFactory extends BaseTokenFilterFactory implements Reso } synMap = new SynonymMap(ignoreCase); parseRules(wlist, synMap, "=>", ",", expand,tokFactory); - if (wlist.size()<=20) { - SolrCore.log.fine("SynonymMap "+synonyms +":"+synMap); - } } } @@ -132,7 +127,7 @@ public class SynonymFilterFactory extends BaseTokenFilterFactory implements Reso } return synList; } - + private static List splitByTokenizer(String source, TokenizerFactory tokFactory){ StringReader reader = new StringReader( source ); TokenStream ts = loadTokenizer(tokFactory, reader); @@ -157,14 +152,14 @@ public class SynonymFilterFactory extends BaseTokenFilterFactory implements Reso tokFactory.init( args ); return tokFactory; } - + private static TokenStream loadTokenizer(TokenizerFactory tokFactory, Reader reader){ return tokFactory.create( reader ); } public SynonymMap getSynonymMap() { return synMap; - } + } public SynonymFilter create(TokenStream input) { return new SynonymFilter(input,synMap);