\r
import com.nexwave.nsidita.BlankRemover;\r
import com.nexwave.nsidita.DocFileInfo;\r
+import org.xml.sax.SAXParseException;\r
\r
/**\r
* Generic parser for populating a DocFileInfo object.\r
//System.out.println("done parsing " + file.getName() + " >>> " + finish);\r
//System.out.println("time = " + (finish - start) + " milliseconds");\r
\r
- }catch(org.xml.sax.SAXException se) {\r
+ }catch(SAXParseException spe){\r
+ System.out.println("SaxParseException: The indexing file contains incorrect xml syntax.");\r
+ spe.printStackTrace();\r
+ }catch(org.xml.sax.SAXException se) {\r
System.out.println("SaxException. You may need to include Xerces in your classpath. " +\r
"See documentation for details");\r
se.printStackTrace(); \r
package com.nexwave.nquindexer;\r
\r
-import java.io.File;\r
-\r
/**\r
* For running tests with the indexertask.\r
* \r
* @version 2.0 2010-08-14\r
* \r
* @author N. Quaine\r
+ * @author Kasun Gajasinghe\r
*/\r
public class TesterIndexer {\r
public static IndexerTask IT = null; \r
* @throws InterruptedException \r
*/\r
public static void main(String[] args) throws InterruptedException {\r
-//\r
-// File file = new File("test");\r
-// System.out.println(file.getAbsolutePath());\r
- System.out.println(args[0]);\r
- if (args.length == 0 ) {\r
- System.out.println("When using the TestIndexer class, you must give the directory of html files to parse as input");\r
- }\r
- \r
- IT = new IndexerTask();\r
- IT.setHtmldir(args[0]);\r
- IT.setIndexerLanguage(args[1]);\r
- IT.execute();\r
- \r
+ if (args.length != 0) {\r
+ IT = new IndexerTask();\r
+ IT.setHtmldir(args[0]);\r
+ IT.setIndexerLanguage(args[1]);\r
+ IT.execute();\r
+ } else {\r
+ System.out.println("When using the TestIndexer class, you must give the directory of html files to parse as " +\r
+ "input. Defaulted to '../doc/content' directory and 'English' language.");\r
+\r
+ String dir = "../doc/content";\r
+ String lang = "en";\r
+ IT = new IndexerTask();\r
+ IT.setHtmldir(dir);\r
+ IT.setIndexerLanguage(lang);\r
+ IT.execute();\r
+ }\r
+\r
}\r
\r
}\r